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!!