Rails 3 submit form with link -
how can submit form link on correct rails 3 format? thanks.
<%= form_for @post |f| %> <%= f.label :title %><br> <%= f.text_field :title %> <p><%= f.submit %></p> <% end %>
my code sample.
"correct" tricky word in context ;) . 1 ask why you're not taking button
element , make link?
anyways — can't achieve plain html (at least not knowledge). javascript framework e.g. jquery this:
$('a').click(function(){ $('form').submit(); return false; });
rails 2.3.x had link_to_remote
helper let's specify :submit
parameter (= dom element's id, default parent form). able write:
link_to_remote 'submit', :url => {…}, :submit => "my_form"
but rails 3's push ujs, helper gone.
Comments
Post a Comment