开发者

reload partial after clic a checkbox

I find a way to submit information after clic on a checkbox.

<% remote_form_for @object do |f|  %>
<%= f.check_box :state, :label => @object.state, :onchange =>
'this.form.onsubmit()'%> <%end%>

I would like to update the view… but no chan开发者_如何学运维ce with the helpers. Any idea how to make it active ?

page[:patentencart].replace_html :partial => 'partial'


Rails 3 response :

<%= form_for @object, :remote => true do |f|  %>
<%= f.check_box :state, :label => @object.state, :onchange => 'this.form.submit()'%>
<%end%>

Change 'this.form.onsubmit()' in 'this.form.submit()'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜