Forum: Ruby on Rails Baffling Ajax.Updater problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9905391b3a73f617a3c0d2e9e32a7273?d=identicon&s=25 Alex Kharlamov (zavulon)
on 2007-07-31 03: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 item.name, {:action => "#"}, {"onmouseover" => "new
Ajax.Updater('display_stuff', 'display', {parameters:'client=IBM'})"} %>


My 'display' action only has one line:

def display
  @client = params[:client]
end

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

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


Any idea, anyone?
Db7238007950074e9e73b76a81910406?d=identicon&s=25 tonypm (Guest)
on 2007-08-04 11:09
(Received via mailing list)
Hi,

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.


HTH
Tonypm
This topic is locked and can not be replied to.