I have Order model which belongs to User model.
I need to create filter in orders by user email.
How can I do it?
If you're looking at orders in orders.rb, and want to limit orders by the associated user then you can do:
filter :user_first_name, :as => :string
which will give you a free text search based on the Order.User.first_name relationship.
The same is true in reverse as long as the has_one and belongs_to relationships are configured correctly:
filter :order_created_at, :as => :string
Hope this is of some help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With