you are here: codestackercodes [RSS]submit a form with a link

submit a form with a link

<!-- view -->
<%= form_for(@category) do |f| %>
	<!-- fields... -->
	<%= link_to 'Submit', '#', :class => 'submit_me' %>
<% end %>

<!-- javascript --> 
$('.submit_me').click(function() {
  $(this).parent().submit();
  return false;
});

Comments