Forum: Ruby on Rails Baffling Ajax.Updater problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alex K. (Guest)
on 2007-07-31 05:04
Hi, I seem to be having a problem with Ajax.Updater passing variables
correctly. I have a Ajax call that does this:

<%= link_to, {:action => "#"}, {"onmouseover" => "new
Ajax.Updater('display_stuff', 'display', {parameters:'client=IBM'})"} %>

My 'display' action only has one line:

def display
  @client = params[:client]

Looking at the log, the variable seems to have been passed correctly:

Processing DisplayController#display (for at 2007-07-29
22:58:06) [GET]
  Session ID: a724b690db0cfe794dd1c3821cbf0919
  Parameters: {"client"=>"IBM", "action"=>"display",

Any idea, anyone?
tonypm (Guest)
on 2007-08-04 13:09
(Received via mailing list)

you havn't said what it isn't doing.

>From the info you provide, @client should be taking on the value of
'IBM'.  But you are doing nothing with that in the controller.  If
your view is displaying the client then you will need to look up the
client IBM from your database using a suitable find operation.  Now
you may be doing this in the view template.  If you are unsure what is
in @client, then try putting
<%= debug @client %> into your template.

This topic is locked and can not be replied to.