Ruby on Rails Saturday, April 5, 2014

May be you searched this?
<%= link_to 'Search', "#", :onclick=>"$('.search_form').submit()" %>


On Friday, April 4, 2014 7:10:22 PM UTC+3, Ruby-Forum.com User wrote:
I have an empty form into a link.  That is instead of having a button
initiate a get request, do it with a link.

The form looks like this:

<%= form_tag somethpath(@data), method: get, :remote => true,
:'data-attr' => @data.id do %>
  <%= submit_tag "Search" %>
<% end %>

Is there an equivalent way to do this using link_to ?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b32eb21c-e55b-4393-b080-0a8e5db40f1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment