Forum: Ruby on Rails Advanced search form & Named scopes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Erez B. (Guest)
on 2009-03-16 11:13
(Received via mailing list)
I have an Asset model in a Real Estate app

See the Search form & Model here:
http://www.qcm.co.il/qcme/index.html

What is the best way to join all named_scope(asset_params) (lines
27..34) to line 36

Thanks

Erez
Frederick C. (Guest)
on 2009-03-16 13:24
(Received via mailing list)
On Mar 16, 9:12 am, "removed_email_address@domain.invalid" 
<removed_email_address@domain.invalid> wrote:
> I have an Asset model in a Real Estate app
>
> See the Search form & Model here:http://www.qcm.co.il/qcme/index.html
>
> What is the best way to join all named_scope(asset_params) (lines
> 27..34) to line 36
>
What you can do is

scope = self
scope = scope.assettype_filter(...) if (...)
scope = scope.dealtype_filter(...) if (...)
...
scope.paginate ...

Fred
This topic is locked and can not be replied to.