Hi
I want to pass two set of values when a particular check box is checked
for eg.
If I have name and email address.
how should I write the view code
if in my controller I want the name and email address accessible from my
params hash…
regards,
warlock
Vinay B. wrote:
Hi
I want to pass two set of values when a particular check box is checked
h> for eg.
If I have name and email address.
how should I write the view code
if in my controller I want the name and email address accessible from my
params hash…
regards,
warlock
not sure about the specifics of a check box but you can just extra
params after you for eg your action/controller.
for example:
<%= link_to_remote “Link name”, :url=>{:controller=> “profile”,
:action=>“index”, :email=>@email,:name=>@name}%>
then in your controller you can access the @email and @name as params
def index
@email = params[:email]
@name = params[:name]
end
i’ve never used a checkbox in this way but I think this is the general
idea. hope it helps.
ohhhh ok … got it… i will try some RnD on this… will reply if i get
any other better way to do this…
Phil T. wrote:
not sure about the specifics of a check box but you can just extra
params after you for eg your action/controller.
for example:
<%= link_to_remote “Link name”, :url=>{:controller=> “profile”,
:action=>“index”, :email=>@email,:name=>@name}%>
then in your controller you can access the @email and @name as params
def index
@email = params[:email]
@name = params[:name]
end
i’ve never used a checkbox in this way but I think this is the general
idea. hope it helps.