On 22.8.2006, at 14.27, Eduardo Yáñez Parareda wrote:
>
> Although link_to_remote works fine, I don't understand (I've already
> read the documentation you told
> me) why link_to doesn't work. Which is the difference usinf link_to or
> link_to_remote?
The former creates a normal, old-fashioned link:
<a href="/entries/6;edit">Edit</a>
The latter creates an Ajax'ed link, clicking of which will trigger an
XmlHttpRequest call:
<a href="/flags/new/6" id="flag_link_6" onclick="new
Ajax.Request('/flags/create/6', {asynchronous:true,
evalScripts:true}); return false;" title="Flag this content as
inappropriate.">Flag</a>
>
> link_to does: call to the controller, then executes action, then
> search
> for a view (.rhtml, .rjs) with
> the same name of the action. Does not link_to_remote do the same
> thing?
Neither of them do that. They are just helpers that produce html (see
above). One creates a normal link, the other an Ajax link.
You can only use RJS templates for Ajax stuff, so link_to_remote is
what you're looking for.
//jarkko
>
>
> >
--
Jarkko Laine
http://jlaine.net
http://odesign.fi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---