Gene Kahn
2006-Aug-12 08:58 UTC
[Rails] Help needed in specifying conditions in pagination
Hi, In a controller, I add to the default list action a condition, thus: def list @user_pages, @users = paginate :users, :conditions => @query, :per_page => 10 end and @query is defined somewhere in the controller as @query = "user_name like ''%Smith%''" where user_name is an attribute of User. Result: The condition pulls out the whole table, not just the users with partial name value "Smith". What''s the correct way of specifying a condition in pagination using a variable? (Can''t find an example in the Rails API doc). Thanks for the help, gk -- Posted via http://www.ruby-forum.com/.