I have this in my view List:
<p><label> Delete all user have more than (month): </label>
<%= text_field_tag("month", p, :size => 10 ) %>
<%= link_to 'Delete', :confirm => 'Are you sure?',:month => p,:action =>
"destroyMonth"%></p>
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!!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---