Forum: Ruby on Rails help for the hidden fileds

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
380d36b061397d40243ad4b86bddf7b5?d=identicon&s=25 Ramya (Guest)
on 2009-02-05 20:15
(Received via mailing list)
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
This topic is locked and can not be replied to.