Hello guys,

Im trying to make an advanced search form, actually i did like Ryan Bates
teaches in this railscast :
http://railscasts.com/episodes/111-advanced-search-form

But my problem is that i dont want to save the searches in my database and i
dont know how to do this...

In the railscast, there was a comment like this:

*14. Karl <http://www.vbsfinder.com/> May 26, 2008 at 23:01 *

*For those who may not know, if you don't want to save your searches in the
database, but would like all benefits of using an AR model (like
validations), you can use virtual attributes:*

*class Search < ActiveRecord::Base
  attr_accessor :keywords, :category_id, : minimum_price, :maximum_price
  validates_presence_of :keywords
  # blah...
end*

*Everything works the same, just doesn't save anything. And no need for a
migration or 'searches' table in db.*

But i tried it, and when i put the att_accessors in my model and try to make
the search, the search returns me all the produtcs.. it dont make the
search..

Does anyone knows how to solve this problem?

Thanks

*
*

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

Reply via email to