# Conection

**URL:** <https://www.ruby-forum.com/t/conection/174214>\
**Category:** Rails\
**Created:** [August 22, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/conection/174214 "2009-08-22T18:05:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![soller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@soller](https://www.ruby-forum.com/u/soller)\
**Post date:** [August 22, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/conection/174214/1 "2009-08-22T18:05:09Z")

</div>

I have this in my view List:

Delete all user have more than (month): \<%= text\_field\_tag("month", p, :size =\> 10 ) %\> \<%= link\_to 'Delete', :confirm =\> 'Are you sure?',:month =\> p,:action =\> "destroyMonth"%\>

and in the controller i have the method destroyMonth

def destroyMonth (month)  
now= Time.now  
puts now.months\_ago(month)  
puts now.to\_s(:db)  
@user = User.find(:all, :conditions =\> [“updated\_at \< ?”,now])  
for e in @user  
e.destroy  
end  
redirect\_to :action =\> ‘list’  
end

How can I at the parameter in the method???

Thank you!!

---

<div class="post-metadata">

**Author:** ![soller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@soller](https://www.ruby-forum.com/u/soller)\
**Post date:** [August 24, 2009, 3:33pm UTC](https://www.ruby-forum.com/t/conection/174214/2 "2009-08-24T15:33:07Z")

</div>

To access the month parameter:

params[:month]

You don’t need to add the month as an argument to the method.

def destroyMonth(month)

should be def destroyMonth

and if you are following ruby style the method should be written in  
camel\_case

def destroy\_month

Cheers,  
Nicholas

On Aug 22, 12:05 pm, Soller P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![soller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/2acd7d/32.png) [@soller](https://www.ruby-forum.com/u/soller)\
**Post date:** [August 24, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/conection/174214/3 "2009-08-24T15:58:00Z")

</div>

oohh thank you!! I solved!!!
