I''m new to RJS and am trying to figure out how @params are passed/
available with my hierarchy.
# views/test/person.rhtml
<%= link_to_remote(''GO'', {:url =>
"/test/show?name=walker&age=77"})%>
<div id=''name''>frank</div><div
id=''age''>33</div>
# controllers/test_controller.rb
class TestController < ApplicationController
def update_person
render :update do |page|
page.show_helper
end
end
end
# helpers/application_helper.rb
module ApplicationHelper
def show_helper(params)
page.replace_html ''name'', :partial =>
''name''
page.replace_html ''age'', :partial =>
''age''
end
end
# views/test/_age.rhtml
26
# views/test/_name.rhtml
Tony
Ideally, I would like the @params in views/test/person.rhtml to be
available in their respective partials as such:
<%= @params[:age] %>
and
<%= @params[:name] %>
Thanks in advance for any help you may be able to offer
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---