ajaxprototypejsrjslink-tolink-to-remote

Can't get rjs to work right, maybe issue with difference between link_to_remote and link_to with :remote => true


I am having problems setting rjs up and I don't know the right way to code this for rails 2.3.14
Are they (link_to_remote and link_to with :remote > true) the same or do they reflect rails versions or are they in fact different?
I am using prototype, as required by my company (so jquery is not an option).

I also see that there is link_to_function so I am really not sure what the right approach is!


Solution

  • link_to :remote => true is a Rails 3 convention and doesn't work in Rails 2. Since you are using Rails 2.3 you'll want to use link_to_remote for ajax calls.

    link_to_function is used for when you want some javascript to run when a link is clicked and not necessarily an ajax call to the server. Stuff like showing/hiding elements on a page.