Ruby on Rails Monday, September 9, 2013

Hi,

I have a dropdown in my rails partial which onchange calling a remote function...I am using rails2.3 verison.. In the drop down I am retreiving list of students like this..

    <%= select :students, :id,
                         @students.map {|s| [s.name, s.id] },
                         {:prompt => "Select A Student"},
                         {:onchange => "#{remote_function(
                                 :url => { :action => 'type' },
                                 :method => 'get',
                                 :with => "'stud_id='+value",
                                 :before => "Element.show('loader')",
                                 :success => "Element.hide('loader')"  )}"} %>
This is working fine... I get list of students with their ids as values.. But I need to add one more option as "All students" to the dropdown so that I can view the details of all the students. How would I achieve it. Please put your thoughts on this as I am new to rails and learning it...

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bff81204-dacb-420f-92b2-0152d88cc4d1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment