The problem you have is you are putting a link in to form, expecting that to
post the form. Try this...
replace your start_form_tag with <%= start_form_tag :action =>
''find_term''
%>
and then repalce your link_to call with <%= submit_tag
''Find'' %>
mark
On 7/3/06, Gene Kahn <kublaikhan55@hotmail.com>
wrote:>
> Hello,
>
> The following view:
>
> <%= start_form_tag %>
> Enter term to find
> <p>
> <%= text_field_tag :name, params[:name] %>
> </p>
> <%= link_to "Find", { :action =>
''find_term''} %>
> <%= end_form_tag %>
>
> does not appear to pass back the value of :name to the action:
>
> def find_term
> term = Term.find_by_name(params[:name])
> if term
> redirect_to :controller => "term", :action =>
"show", :id =>
> term.id
> else
> flash[:notice] = "Unable to find the term: #{term}"
> end
> end
>
> The notice printed is:
>
> Unable to find the term:
>
> How do I pass back the value of the inputted variable to the controller?
> ''elp!
>
> gk
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Mark Van Holstyn
mvette13@gmail.com
http://lotswholetime.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060703/e8681dac/attachment-0001.html