Displaying 3 results from an estimated 3 matches for "search_criteria".
2006 Jul 21
4
observe_field submit behavior
I am using observe_field on a number of multi-selects and checkbox form
elements whose values would normally come in as arrays on a normal
(non-Ajax) form post.
I understand that by using the :with => ''name'' I will get name=value in
the request.raw_post however if the field I am submitting has mutliple
values and the name is of the form ''name[]'', I get
2006 Oct 02
6
Strange Sorting Issues
Hi there,
I''m having some strange sorting stuff goign on. Here''s my search method:
sort_fields = []
sort_fields << Ferret::Search::SortField.new("name",
:reverse => :false)
@results = Listing.find_by_contents @search_criteria, :limit => :all,
:sort => sort_fields
page = (params[:page] ||= 1).to_i
items_per_page = 9
offset = (page - 1) * items_per_page
@pages = Paginator.new(self, @results.length, items_per_page, page)
@results = @results[offset..(offset + items_per_page - 1)]
For some queries, the sorting...
2006 Jul 03
0
Pagination with acts_as_ferret
Hey there,
Previous to finding ferret I had a test query setup to do pagination
like:
@listing_pages, @listings =
paginate(:listing, :per_page => 10,
:conditions => [" name LIKE ? ", "%" + search_criteria +
"%"],
:order_by => "name ASC")
Can I do similar pagination with @results array returned from a ferret
query?
Thanks. :)
--
Posted via http://www.ruby-forum.com/.