I have a Store model that has_many Products.  I need to allow the users
to filter on certain conditions in the products.  For example, products
at the store that cost more than $50.  I am planning on getting the
parameter in the controller and modifying the product collection.  I
have experimented with a few things, but I think there is probably an
elegant solution out there.  I want to be able to filter and then call
the collection using: store.products, since this is in a shared view.  I
have tried replacing the products with a new collection, but rails
automatically modifies the database (store.products =
filtered_products).  I dont want it to save as this is just going to be
a read.  Is there an easy way that I can pass conditions in store model
to get the products I want in the controller and then call the
collection using store.products in the view?
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to