On Sep 19, 12:39 pm, Heinz Strunk <[email protected]>
wrote:
> Hello,
>
> I don't really know how to solve following problem: When I access
> .../users/1 I get the website and the user is shown properly, all good.
> I have some link_to_remote actions on my website and when they call the
> /users/1 action I - of course - get the whole page rendered despite I
> just wanted to update a div with only name being displayed. My question
> now is how it's possible to determine within the action if it's an HTTP
> or AJAX request and render accordingly (full layout for HTTP and only
> one DIV box for the AJAX request).
>
I'm sure you know this but AJAX requests are of course http
requests :-).
There's the xml_http_request? method (also available as xhr? ) and of
course respond_to is designed for this sort of stuff.
Fred
> How would you solve that kind of problem?
>
> Thank you,
> Heinz
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---