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

StackOverflow https://stackoverflow.com/questions/8539400

Frage

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!

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top