Monthly Archives: March 2009

A Neat RubyOnRails Profile Link Helper

I am working on a project for my client and they have a movie and an associated list of actors. When viewing a movie, they want to be able to list all the actors starring in it, obviously.
123def link_to_actors(actors, options = {})
  actors.map{ |a| link_to(a.full_name, actors_path(a), options) }.to_sentence
end
This uses map to iterate over each actor, [...]