Content within form_for tags not being executed in rails 3.2 partial that is rendered using ajax -
update:solved simple error of not putting equals sign after % sign! hi folks have partial being rendered correctly not displayed on web page @ all. here partial 'exam/_exam_marks_form':
<% form_for ([@batch, @exam_group]), :remote=> true |f| %> <h1>render me</h1> <%end%>
from log info, partial being rendered correctly:
rendered exam/_exam_marks_form.erb (3.2ms) rendered exam/update_exam_form.js.erb (4.9ms) completed 200 ok in 175ms (views: 9.5ms | activerecord: 3.8ms)
the problem contents of partial not being displayed or executed. have noticed enclosed in form_for tags not being executed.raw html working fine. missing? routes follows:
resources :batches resources :exam_groups resources :additional_exam_groups resources :elective_groups end resources :exam_groups resources :exams member post :save_scores end end
end
the partial meant rendered in page under id 'exam_form':
<div class="row"> <div class="span6 offset3"> <%= form_for :exam_option,:remote=> true, :url => { :controller=>'exam',:action => 'update_exam_form',:batch=>@batch} |form| %> <%= form.submit "save", class: "btn btn-large btn-primary" %> <%end%><%end%> <div id="exam-form"></div> </div></div>
the relevant update_exam_form.js.erb file shown:
$("#exam-form").html("<%= escape_javascript(render('exam/exam_marks_form')) %>")
i think problem form_for somewhow not being recognized because raw html working fine. appreciated :)
Comments
Post a Comment