xlu/recordselect
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
RecordSelect
============
(c) 2011 - Xiaoming Lu
Background: Modify record_select to use Thinking Sphinx search instead of traditional database search (eg Mysql search). Also want to allow user to
search by record id, instead of only text field.
Model:
Needs to set up record_select to choose whether to disallow Thinking Sphinx search. By default, if :wurl_disable_thinking_sphinx is not set,
record_select will use Thinking Sphinx search. If :wurl_allow_search_by_id is set, then when user types in valid record id in the search box,
record_select will search by id, using model.find_by_id(id).
Example:
record_select :per_page => 10, :search_on => 'title', :order_by=>'title',
:text_search =>:full, :model=>:feed, :label=>'record_select_item',
:wurl_allow_search_by_id=>true
# optional :wurl_disable_thinking_sphinx=>true
Of course you also need to set up is_index block to use Thinking Sphinx search.
= DEPENDENCIES
This depends on the excellent Paginator gem by Bruce Williams. This simple gem is available at paginator.rubyforge.org.