Dynamic Select Boxes with forms
I'm fairly new at Ruby and Rails and have been having some trouble trying to figure out an easy way of doing dynamic drop down list.
I've been trying to follow guide to do what I want to do, but I've stumble on a few issues and would like your guy's help.
So what I have is 4 tables [Client, Project, Category, MeetingMinute]
What I want to do is to create a form for MeetingMinute in such a way that the user would first select the Client which then would auto populate the Project dropdown list. And when a subset of the Project is selected, again, the category would be filtered specifically for the project.
I've been using this site as a reference http://pullmonkey.com/2008/3/30/dynamic-select-boxes-ruby-on-rails/
I'm able to it to run on the example, but when I have the example used under a <% form_for(@Project) do |f| %>
I'm not too 开发者_Go百科sure how I can pass the |f| to the partial and use the <%= f.select :project_id, options_from_collection_for_select ...
If anyone have a better reference or solution, please provide. I appreciate your time and help. Thanks.
This might be useful.
http://railscasts.com/episodes/88-dynamic-select-menus
精彩评论