# Help for the hidden fileds

**URL:** <https://www.ruby-forum.com/t/help-for-the-hidden-fileds/159563>\
**Category:** Rails\
**Created:** [February 5, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/help-for-the-hidden-fileds/159563 "2009-02-05T20:15:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@ramya](https://www.ruby-forum.com/u/ramya)\
**Post date:** [February 5, 2009, 8:15pm UTC](https://www.ruby-forum.com/t/help-for-the-hidden-fileds/159563/1 "2009-02-05T20:15:41Z")

</div>

hi there

I am a newbie i am creating a report a bug application.

while the user clicks the link i need to catch up few hidden fields  
like http\_user\_agent and save it database.

So i did something like this

\<%= link\_to “Report Bug”, :controller =\> ‘bug’, :action =\>  
‘new’, :http:user\_agent =\> request.env[‘HTTP\_USER\_AGENT’]%\>

I have a controller in which i didnt include any code for catching the  
hidden\_field .The controller works just fine in getting the statements  
from the user saving it in the database.  
but couldnt figure how to pass the hidden fileds along with  
statements.

class BugController \< ApplicationController  
def new  
@bug = Bug.new  
end

def create  
@bug = Bug.new(params[:bug])  
if @bug.save  
redirect\_to :action=\> ‘index’  
else  
flash[:notice] = ‘please enter your statements’  
redirect\_to :action =\>‘new’  
end  
end

def index  
end  
end

and then views new.rhtml and index.rhtml.

so how should i go abt collecting the env variables…

let me know any suggestion

Regards  
Ramya
