# Problem with parameters

**URL:** <https://www.ruby-forum.com/t/problem-with-parameters/155503>\
**Category:** Rails\
**Created:** [December 12, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503 "2008-12-12T16:00:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 12, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/1 "2008-12-12T16:00:03Z")

</div>

First at all sorry if my english is not the best.

In the view I have this code:

\<%= select\_tag “tabla”, options\_for\_select([“Famitel”, “Polycom Kirk”,  
“LG Nortel”, “Dimax Videovigilancia”]) %\>  
\<%= text\_field :buscar, params[:codigo\_aleatorio]%\>  
\<%= button\_to “Buscar” , :action =\> :elijovista %\>

In elijovista´s controller I need to know the item that was selected  
in  
tabla and the text.

my code is:  
def elijovista  
debugger  
return params[:payment]

```
case :tabla
    when "Famitel"
     @ticket=Ticket.find( :first, :select =>"reference",

```

:conditions=\>[‘codigo\_aleatorio=?’,params[:codigo\_aleatorio]])

```
    # renders app/views/zonaclientes/showFamitel
    render :template => 'zonaclientes/showFamitel'
  return

```

.  
.  
.  
.  
(The same for the rest of the items)  
.  
.  
But render never works, always show the elijovista view.

Whats wrong? How can obtain the option selected in tabla?

Thanks for all

---

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 12, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/2 "2008-12-12T16:01:50Z")

</div>

On 12 Dec 2008, at 14:49, joripel wrote:

> \<%= button\_to “Buscar” , :action =\> :elijovista %\>
> 
> In elijovista´s controller I need to know the item that was selected  
> in  
> tabla and the text.
> 
> my code is:  
> def elijovista  
> debugger  
> return params[:payment]

return halts processing of the action

Fred

---

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 13, 2008, 11:58am UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/3 "2008-12-13T11:58:27Z")

</div>

The problem is that in the view when i push the button it works like  
a link\_to and tabla y codigo\_aleatorio aren’t present in elijovista ☹

Any help? I don’t know how solve this

---

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 12, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/4 "2008-12-12T16:22:23Z")

</div>

Sorry, I did several tests.This two lines don’t exists  
debugger  
return params[:payment]

---

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 14, 2008, 11:11am UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/5 "2008-12-14T11:11:29Z")

</div>

With case params[:tabla] the variables are the same. I can’t use  
params[:tabla] in elijovista controller ☹

---

<div class="post-metadata">

**Author:** ![chimorito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/54ee81/32.png) [@chimorito](https://www.ruby-forum.com/u/chimorito)\
**Post date:** [December 13, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/problem-with-parameters/155503/6 "2008-12-13T14:16:32Z")

</div>

On Dec 12, 2:49 pm, joripel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> case :tabla
> when "Famitel"
> 
> ```

These lines here are also weird. The lines below would only run  
if :table were to be === to “Famitel”, which would never happen. (did  
you mean params[:tabla] ?

Fred
