I am using rails-3.2.1 with blacklight application
I am trying to invoke remote_function in my link_to tag.
<%= link_to_document document, :label=>document_show_link_field, :onclick => remote_function(:controller => 'catalog', :action => 'save_user_history') %>
This gives following error
undefined method `remote_function' for #<#<Class:0x2ff0dc0>:0x2f4af38>.
Does anyone know why?
This function was part of the Prototype helper which was removed from the framework with Rails 3.1 and moved to the prototype-rails gem.
You can always use a normal link_to.
<%= link_to "Save User History", save_user_history_catalogs_path %>
Or if it is a ajax function, something like this:
<a id="save_user_history">Save User History</a>
And in your javascript file:
$("#save_user_history").click(function() {
$.post("/catalogs/save_user_history", function(data) {
....
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