I’m trying to make query in RoR, but my conditions are coming from params and changing dynamically.
I’ve tried this:
@userlist = User.find(:all, conditions:{(name:params[:name] if params[:name] != nil), (lastname:params[:lastname] if params[:lastname] != nil)})
It’s just my imagination, but shows what I mean.
thanx
If you’re on Rails 3:
etc..