Using the agility tutorial example:
def show
@project = find_instance
@stories =
@project.stories.apply_scopes(:search => [params[:search],
:title],
:order_by =>
parse_sort_param(:title, :status))
end
You can simply add further scopes to the chain or the apply_scopes:
@project.stories.not_completed.apply_scopes(...)
You can either use Hobo's automatic scopes:
http://cookbook.hobocentral.net/manual/scopes
or Rails' named scopes:
http://ryandaigle.com/articles/2008/3/24/what-s-new-in-edge-rails-has-finder-functionality
Bryan
On 10-09-14 08:12 PM, Abbasi Ujjainwala wrote:
Hi,
I have a requirement to search only one type of entity or allow user to
select which entity she wants to search on.
The default search basically searches across the board, so question is
how can I configure it to search just the entity which user wants?
regards,
abbasi
ph: 678 425 4556
--
You received this message because you are subscribed to the Google
Groups "Hobo Users" 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/hobousers?hl=en.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en.