# Updating a Page Param using Observe Field

**URL:** <https://www.ruby-forum.com/t/updating-a-page-param-using-observe-field/134177>\
**Category:** Rails\
**Created:** [April 8, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/updating-a-page-param-using-observe-field/134177 "2008-04-08T16:58:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keaja](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/838e76/32.png) [@keaja](https://www.ruby-forum.com/u/keaja)\
**Post date:** [April 8, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/updating-a-page-param-using-observe-field/134177/1 "2008-04-08T16:58:19Z")

</div>

I am trying to have the user select a drop down, which will then  
update a page param, and then have a link on the page use that param.  
My problem is that when the user chooses the drop down, the param for  
the page is not being updated and the link is not passing the  
category\_type param.

Error from the development.log

NoMethodError (You have a nil object when you didn’t expect it!  
The error occurred while evaluating nil.value=):

View:

 Type 1 Type 2 Type 3

\<%= observe\_field ‘category\_type’, :url =\> {:controller =\>  
‘categories’, :action =\> ‘update\_category\_type’}, :with =\>  
“‘categoryType=’ + value” %\>

\<%= link\_to ‘Select’, :controller =\> ‘categories’, :action =\>  
‘choose\_category’, :id =\> category, :category\_type =\>  
params[:category\_type\_link] %\>  
Controller:

def update\_category\_type  
render :update do |page|  
params[:category\_type\_link].value = “yikes”  
end  
end
