diff options
Diffstat (limited to 'railties/guides/rails_guides/helpers.rb')
-rw-r--r-- | railties/guides/rails_guides/helpers.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/guides/rails_guides/helpers.rb b/railties/guides/rails_guides/helpers.rb index 463df8a7a8..e6ef656474 100644 --- a/railties/guides/rails_guides/helpers.rb +++ b/railties/guides/rails_guides/helpers.rb @@ -12,6 +12,22 @@ module RailsGuides result end + def documents_by_section + @documents_by_section ||= YAML.load_file(File.expand_path('../../source/documents.yaml', __FILE__)) + end + + def documents_flat + documents_by_section.map {|section| section['documents']}.flatten + end + + def finished_documents(documents) + documents.reject { |document| document['work_in_progress'] } + end + + def docs_for_menu(position) + position == 'L' ? documents_by_section.to(3) : documents_by_section.from(4) + end + def author(name, nick, image = 'credits_pic_blank.gif', &block) image = "images/#{image}" |