append hardcoded value in rails2 f.select_tag

13 views
Skip to first unread message

pradeep...@gmail.com

unread,
Sep 9, 2013, 5:44:41 PM9/9/13
to rubyonra...@googlegroups.com
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...
Reply all
Reply to author
Forward
0 new messages