link_to

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

<table cellpadding="4" cellspacing="0" border="0" width="100%" class="itiltable2"> <tr> <th colspan="4" class="alternative"> <label for="ci_content_functional_spec" >Edit Functional Specification</label> </th> </tr> <tr>     <td width="25%" colspan="4"><%= text_area "ci_content", "functional_spec", "cols" => 120, "rows" => 5 %></td> </tr> </table> <table>   <tr>   <td>    <%= link_to ( "Save", {:controller => :ci, :action => :edit_ci_functional_spec, :ci => @ci, :method => 'post'}, {'class' => 'itilbuttonlink1'})%>   </td>   <td>   <%= link_to ( "Cancel", {:controller => :ci, :action => :edit, :ci => @ci}, {'class' => 'itilbuttonlink1'})%>   </td>

  </tr> </table>

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

   <td width="25%" colspan="4"><%= text_area "ci_content", "functional_spec", "cols" => 120, "rows" => 5 %></td> </tr> </table> <table> <tr> <td>   <%= link_to ( "Save", {:controller => :ci, :action => :edit_ci_functional_spec, :ci => @ci, :method => 'post'}, {'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.

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'})%>   </td>

@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'})%>   </td>

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"