Advanced search form & Named scopes


#1

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


#2

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