# Still struggling with data flow

**URL:** <https://www.ruby-forum.com/t/still-struggling-with-data-flow/96894>\
**Category:** Rails\
**Created:** [July 3, 2006, 9:20am UTC](https://www.ruby-forum.com/t/still-struggling-with-data-flow/96894 "2006-07-03T09:20:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [July 3, 2006, 9:20am UTC](https://www.ruby-forum.com/t/still-struggling-with-data-flow/96894/1 "2006-07-03T09:20:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [July 3, 2006, 10:37am UTC](https://www.ruby-forum.com/t/still-struggling-with-data-flow/96894/2 "2006-07-03T10:37:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kublai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a3d4f5/32.png) [@kublai](https://www.ruby-forum.com/u/kublai)\
**Post date:** [July 3, 2006, 11:13am UTC](https://www.ruby-forum.com/t/still-struggling-with-data-flow/96894/3 "2006-07-03T11:13:19Z")

</div>

Mark Van H. wrote:

> 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

Mark,  
It works!  
Thanks,  
gk
