view:
<% form_for @somthing, :url => edit_something_path(@something) do |f|
%>
<%= form.text_field :reg_number, :size => 30, :class => "textInput"
%>
<% end %>
controller:
def edit
@something = params[:something] ? Something.find_by_reg_number(params
[:something][:reg_num]) : Something.find(params[:id]
end
On Nov 7, 11:48 pm, shila romualdo <
shiro...@gmail.com> wrote:
> thanks for the input.. i've tried putting the params in a variable but still
> when i passed it to the other form the value disappeared.. here are my
> codes:
>
> view:
> <div class="form_row">
> <label for="regnum">Register Num:</label>
>
> <%= form.text_field :regnum, :size => 30, :class => "textInput",
> :value => @passed %>
>
> </div>
>
> controller:
> def edit
> @passed = params['regnum']
> @something = Something.find_by_reg_number(@passed)
>
> end
>
> On Sat, Nov 7, 2009 at 9:29 PM, Ramon Tayag <
ramon.ta...@gmail.com> wrote:
>
> > It should be in the params. Just check your params in your controller,
> > assign it to a variable or something like that
>
> > def new_form
> > @passed_on_value = params['name_of_that_field']
> > ..
> > end
>
> > then in your view
>
> > ...
> > f.text_field :passed_value, :value => @passed_on_value
> > ..
>
> > Something like that :)
>
> > Ramon Tayag
> > -
> > what you think, we ink
> >
http://theinksquad.com
>
> > 2009/11/7 shila romualdo <
shiro...@gmail.com>: