views:

21

answers:

1

I have just started using Yard to generate my docs and whilst it works great for my models and controllers, I can't seem to get it to generate anything for the views

I've tried a variety of different ways to get it to work. Currently I've set up a rake task to generate the docs that looks something like this

YARD::Rake::YardocTask.new do |t|
    t.files   = ['lib/**/*.rb', 'app/**/*.rb', 'app/views/**/*.erb']
    t.options = []
end

The last path there, I believe, should get it to include my views but when I look at the docs, there's no mention of any of these files at all. Any ideas why?

Cheers

A: 

Template files are not expected to contain Ruby methods or business logic. What kind of documentation would you like to generate?

Simone Carletti
Hi, I would like to include a description of the template saying what the template is used for (eg 'Template for displaying a users profile'). Sometimes I have variables that can be passed to the template for when I require mostly the same thing but some slight differences. So when rendering a partial I might use something like 'render :partial => "user_summary", :locals => {:displayAvatar => true}'. By testing for this variable in the template, I can use the same template with or without the Avatar rather than have 2 templates. I would like to include a list of these variable in the docs
Addsy