I am very new to RoR (this is my second day).  I have started my first
application, and want to follow best practices as much as possible.  I
created a select box that lists all the items in a table column on a
new.html.erb page.  I then realized I needed to create one on the edit
page. I want to use this select box on several other pages as well.

Trying to keep with D.R.Y. I am wondering if there is a better way to
do this, instead of putting this statement on every page.

<%= select("note", "project_id", Project.find(:all).collect {|p|
[p.name, p.id]}) %>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to