# RJS & Variable Scopes

**URL:** <https://www.ruby-forum.com/t/rjs-variable-scopes/109174>\
**Category:** Rails\
**Created:** [July 12, 2007, 5:37am UTC](https://www.ruby-forum.com/t/rjs-variable-scopes/109174 "2007-07-12T05:37:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![d0t1q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@d0t1q](https://www.ruby-forum.com/u/d0t1q)\
**Post date:** [July 12, 2007, 5:37am UTC](https://www.ruby-forum.com/t/rjs-variable-scopes/109174/1 "2007-07-12T05:37:16Z")

</div>

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

frank

33

# 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
