# Image\_select\_tag with name and value

**URL:** <https://www.ruby-forum.com/t/image-select-tag-with-name-and-value/63560>\
**Category:** Rails\
**Created:** [June 16, 2006, 8:52am UTC](https://www.ruby-forum.com/t/image-select-tag-with-name-and-value/63560 "2006-06-16T08:52:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [June 16, 2006, 8:52am UTC](https://www.ruby-forum.com/t/image-select-tag-with-name-and-value/63560/1 "2006-06-16T08:52:13Z")

</div>

What have I missed

I have a .rhtml with the sandard form parameters

\<%= image\_submit\_tag(“excel.gif”, :alt =\> “Download List to Excel”,  
:border =\> 0, :name =\> ‘render\_action’, :value =\> ‘excel’ ) %\>

Which genenerates I believe a valid html fragment for a submit button.

BUT my controller doesnt pick up the value of params[:render\_action] ?

```
if params[:render_action].nil?
     render
  else
   mytext = render_to_string(:action => 'list_excel', :layout => 

```

false)  
send\_data mytext, :type =\> ‘application/vnd.ms-excel’,  
:disposition =\> ‘inline’  
end

It works if I create a standard check box tag  
Download Results to Excel:\<%= check\_box\_tag (“render\_action”,  
value=“excel” ) %\> but I want it this to work as a check\_box button.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [June 16, 2006, 9:24am UTC](https://www.ruby-forum.com/t/image-select-tag-with-name-and-value/63560/2 "2006-06-16T09:24:20Z")

</div>

Why not create a hidden field to hold the value?

-jwm

---

<div class="post-metadata">

**Author:** ![glenn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/4bbf92/32.png) [@glenn](https://www.ruby-forum.com/u/glenn)\
**Post date:** [June 16, 2006, 9:42am UTC](https://www.ruby-forum.com/t/image-select-tag-with-name-and-value/63560/3 "2006-06-16T09:42:55Z")

</div>

Jonathon M. wrote:

> Why not create a hidden field to hold the value?
> 
> -jwm

I actually want two submit buttons

a) Standard submit button which just does a submit “View”  
b) Submit with “render\_action” excel “View with Excel”

If I have a hidden field with the render action then if the user clicks  
the standard button the hidden field value would result the render to  
excel whichever button is clicked.
