I have the following:
<%= link_to "Exhibitions", :action => 'tabExhibitions', :id => @app.id, :remote => true %>
It generates:
<div class="tabbarButton" id="tabbarExhibitions">
<a href="/apps/3/tabExhibitions?remote=true">Exhibitions</a>
</div>
Which results in a common GET request when clicked.
I am new to Rails but my understanding was that setting :remote => true
should have created a <a href="..." data-remote=true>
instead of a plain link.
I am using jQuery, the necessary headers and meta tags are in place. I should mention this project was upgraded from Rails 2.3.8
Thanks for all the help.
link_to
is putting :remote => true
into the url
portion of the argument list, and creating a query-string parameter for it (see the parameters in the documentation). Essentially, what you've written is:
<%= link_to "Exhibitions", { :action => 'tabExhibitions', :id => @app.id, :remote => true } %>
You'll want to have a separate Hash for the html_options
:
<%= link_to "Exhibitions", { :action => 'tabExhibitions', :id => @app.id }, :remote => true %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With