使用带标签的列表记录类

时间:2011-06-26 20:29:23

标签: ruby-on-rails ruby class documentation rdoc

我正在使用Ruby on Rails 3.0.7,我正在使用RDoc为我的应用程序编写一些文档。在我的应用程序文件中,我有:

#[EXAMPLE 1 - Some text.]
#
#  [CASE 1 - Some text.]
#  
#    class User < ActiveRecord::Base
#      has_many :account,
#        :class_name  => 'User::Account',
#        :foreign_key => 'account_id'
#    end

在为我的应用程序生成文档时,上面注释的代码会将class User < ActiveRecord::Baseend部分留在段落块之外的那些部分。

以下是相关的截图:

enter image description here

我该如何解决?

如果我使用这个

,我得到相同的输出(在应该出现类语句的段落块之外)
#[Example 1 - Some text.]
#  
#  class User < ActiveRecord::Base
#    has_many :account,
#      :class_name  => 'User::Account',
#      :foreign_key => 'account_id'
#  end

或者

#class User < ActiveRecord::Base
#  has_many :account,
#    :class_name  => 'User::Account',
#    :foreign_key => 'account_id'
#end

1 个答案:

答案 0 :(得分:0)

你只在#和这两行的单词之间留下了三个空格。它们应至少为四个空格。将所有代码行缩进一个空格,它应该可以工作。

相关问题