query: tag:remote_form_for
たとえばJavaScriptの都合などでactionがnewでもeditでもフォームタグのidが同じになって欲しいことがある。 そういう場合は:html=>{:name1=>'value1',:name2=>'value2'}でhtmlオプションを指定できる。 ruby>> <% remote_form_for(@article, :url => {:action => :update, :id => @article}, :update => 'list',:html=>{:id=> 'article'}) do |f| %> <%= render :partial=>f %>

<%= f.submit "保存" %>

<% end %> <
posted by ysakaki ysakaki on Tue 19 Aug 2008 at 11:53 with 0 comments