Link_to

I have an edit_func_spec_ui.rhtml file in the controller
popup_controller:

Edit Functional Specification
<%= text_area "ci_content", "functional_spec", "cols" => 120, "rows" => 5 %>
<%= link_to ( "Save", {:controller => :ci, :action => :edit_ci_functional_spec, :ci => @ci, :method => 'post'}, {'class' => 'itilbuttonlink1'})%> <%= link_to ( "Cancel", {:controller => :ci, :action => :edit, :ci => @ci}, {'class' => 'itilbuttonlink1'})%>

The link “Save” calls an action edit_ci_functional_spec in another
controller ci_controller:
def edit_ci_functional_spec
@ci = Ci.find(params[:ci])
@ci.content.functional_spec= params[:ci_content][:functional_spec]
@ci.content.save
redirect_to :action => ‘edit’, :ci => @ci
end

But i’m not getting the value of params[:ci_content][:functional_spec]
in the above action. Anyone please help me to solve this.

Thanks in advance
Suneeta

‘itilbuttonlink1’})%>
But i’m not getting the value of params[:ci_content][:functional_spec]
in the above action. Anyone please help me to solve this.

Why would it? Save is just a link and fuctional_spec is a textfield
elsewhere on the page. Sounds like you want a form instead.

Fred

Suneeta Km wrote:

<%= link_to ( “Save”, {:controller => :ci, :action =>
:edit_ci_functional_spec, :ci => @ci, :method => ‘post’}, {‘class’ =>
‘itilbuttonlink1’})%>

@ci.content.functional_spec= params[:ci_content][:functional_spec]
@ci.content.save
redirect_to :action => ‘edit’, :ci => @ci
end

But i’m not getting the value of params[:ci_content][:functional_spec]
in the above action. Anyone please help me to solve this.

Thanks in advance
Suneeta

Where in the above link_to method do you see yourself setting the
params[:ci_content][:functional_spec]…

You are setting the params[:ci] (which you grab later but not the
former)

hth

ilan

<%= link_to ( “Save”, {:controller => :ci, :action =>
:edit_ci_functional_spec, :ci => @ci, :method => ‘post’}, {‘class’ =>
‘itilbuttonlink1’})%>

You cannot post form variables without using form. It’ll be better to
use form and submit button instead of links.

Thanks

Buttons are not customizable enough for me. I used something like that

link_to “Submit”, 'javascript:document.forms[0].submit(); ',
:class=>“button”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs