# How: varibale as the parameter in params\[\]

**URL:** <https://www.ruby-forum.com/t/how-varibale-as-the-parameter-in-params/103595>\
**Category:** Rails\
**Created:** [May 8, 2007, 8:50am UTC](https://www.ruby-forum.com/t/how-varibale-as-the-parameter-in-params/103595 "2007-05-08T08:50:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichikawa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/96bed5/32.png) [@ichikawa](https://www.ruby-forum.com/u/ichikawa)\
**Post date:** [May 8, 2007, 8:50am UTC](https://www.ruby-forum.com/t/how-varibale-as-the-parameter-in-params/103595/1 "2007-05-08T08:50:08Z")

</div>

hi guys,

In my rails rhtml page I have several check box named as param0,  
param1…param9.

in my controller method I want to obtain the value by a loop.  
I have generated the name of the post values  
by this code:

@total=Array.new  
count=0  
while count\< 10  
param\_me=‘param’+count.to\_s  
#@total \<\< params[:param\_me]  
@total \<\< val\_index  
count=count+1  
end

I want to store the values in the array: @total

In the comment line how can i place the param\_me which will work as the  
following line:

@total \<\< params[:param0]  
@total \<\< params[:param1]  
.  
.  
.  
@total \<\< params[:param9]

please take a hand in my code

ichikawa
