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”})%>
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