1

I am using Ruby on Rails 3.0.7 and I am writing some documentation for my application using RDoc. In my application file I have this:

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

On generating documentation for my application the above commented code will leave class User < ActiveRecord::Base and end parts outside the paragraph block where those should appear.

The following is the related screen shot:

enter image description here

How can I solve that?

I get the same output (outside the paragraph block where the class statement should appear) if I use this

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

or this

#class User < ActiveRecord::Base
#  has_many :account,
#    :class_name  => 'User::Account',
#    :foreign_key => 'account_id'
#end
sawa
  • 165,429
  • 45
  • 277
  • 381
user502052
  • 14,803
  • 30
  • 109
  • 188

1 Answers1

0

You've only left three spaces between the # and the words for those two lines. They should be four spaces minimum. Indent all the lines of code by one more space each and it should work.

Taryn East
  • 27,486
  • 9
  • 86
  • 108
  • I have seen comments on the "other question" (http://stackoverflow.com/questions/6486923/documenting-constants-and-methods - thanks!), but I have still to solve this problem. – user502052 Jun 27 '11 at 10:35