阅读背景:

如何使用remote_function向控制器发送subject参数?

来源:互联网 

Suppose this form:

假设这种形式:

<% form_for(@student) do |f| %>
<%= f.select(:subject_id, 
             options_from_collection_for_select(@subjects, :id, :name), 
             {:prompt => 'Select a subject' },
             {:onChange => "#{remote_function(:update => :student_exam_id,
                                                         :url => { 
                                                            :action => :update_exams_list, 
                                                            :subject_id => 1
                                                         }
                                             )
                             }" } ) %>
<%= f.select(:exam_id, 
             options_from_collection_for_select(@exams, :id, :title) ) %>
<% end %>
<% form_for(@stu



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: