This one has a dropdown for subjects (math, science), and shows a list of 
courses in the selected subject:

 <%= form_tag('courses/by_subject', :remote => true, :method => "get", 
> :data => { :type => "script" }, :id => 'course_search') do  %>
>      <%= select_tag( "subject_id", options_for_select(Subject.all.collect 
> {|p| [ p.name, p.id ] }),:prompt => 'Select Subject' ) %>
>  <%= submit_tag "Search" %>
> <% end %>
> <div id="course_list">
>     <%= render 'courses' %>
> </div>


You may not need the Subject.all.collect part if you have an array of 
choices.

Ed 

On Tuesday, June 12, 2012 3:54:11 PM UTC-4, JB wrote:
>
> Just wondering what the best way to do something is and was hoping 
> someone could point me in the right direction. I have a drop down box 
> on a form. Depending on the value selected I want to hide and/or show 
> some additional text fields. Any and all thoughts appreciated . . .

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/activescaffold/-/4gl6i-1XTVYJ.
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/activescaffold?hl=en.

Reply via email to