Questions tagged [meta-search]

MetaSearch is a Ruby gem that uses object-based searching for creating search forms.

MetaSearch simplified the task of creating search forms in Ruby on Rails. It provided a DSL for querying models by adding custom fields to the form builder.

The gem is no longer maintained and has been replaced by Ransack. Ransack is a rewrite of MetaSearch and provides many of the same features, but has been designed so that it is easier to maintain with future versions of Rails.

113 questions
2
votes
1 answer

meta_search + datatables

I'm using datatables in my rails 3.1 application. Datatables is set up to work server side. I'm using ajax requests to get data from server and then display it in the table. I use meta_search as a filter to get data from the database. Here is the…
roman
  • 5,100
  • 14
  • 44
  • 77
2
votes
1 answer

meta-search/ransack for mongoid

I was just wondering if anyone has come across anything offering similar search functionality for mongoid as meta-search/ransack? During my searches I came across this mongoid group thread which mentioned sunspot_mongoid. I only had a quick look at…
Conor
  • 775
  • 3
  • 10
  • 23
2
votes
0 answers

Using metasearch's contains search option for non-string data types

While using metasearch gem to do a somewhat complex search I got an error when using the "_contains" option an numerical(decimal) field and later found out in the documentation that it in only works on string data type fields. Since metasearch…
Tds
  • 113
  • 10
2
votes
3 answers

MetaSearch sort ordered column

I have a model: class Event < ActiveRecord::Base default_scope :order => 'date_begin' end There is a sort link in a view file: = sort_link @search, :date_begin When I'm trying to order date_begin as DESC nothing happens because the SQL query…
Aleksandr Shvalev
  • 1,005
  • 2
  • 11
  • 22
2
votes
0 answers

Rails 3 Meta_Search Multi-level associations

I have the following classes class BusinessLocation has_many :campaigns end My campaigns class as an attribute called event_return_rate. I am using meta_search's sort_link url helper to sort a list of Business_Locations using the following…
doug
  • 1,963
  • 2
  • 16
  • 24
2
votes
2 answers

Search by association in Rails 3 with MetaSearch

I'm using MetaSearch gem in my Rails 3 project. I have two models: class Company < ActiveRecord::Base belongs_to :city end class City < ActiveRecord::Base has_many :companies end I have the action in CompaniesController: def index @search =…
2
votes
2 answers

rails activerecord metasearch undefined method

I'm new to rails and need your help for what should be a simple problem. when I run this code: @search = User.search(params[:search]) @foundusers = @search.all.paginate :page => params[:page], :per_page => 20 @user = @search.where("users.id = ?",…
NicdeMor
  • 91
  • 7
2
votes
2 answers

How to set a 0 result in meta_search before user pressing a search button

I'm using a meta_search on my rails 3 app. By default (before pressing a search button) meta_search returns all elements of searching model. and I want to set 0 result before user pressing a search button or if search params is blank. I am using…
Talgat Medetbekov
  • 3,741
  • 1
  • 19
  • 26
2
votes
0 answers

ActiveAdmin meta search filters - filter by association id select dropdown

I have a model setup like this: Sale belongs to Product Product belongs to Varietal Now I want to make a select drop down filter for varietal on sales. The only way I've managed to do this is by name. filter :product_varietal_name, as:…
Alex Wayne
  • 178,991
  • 47
  • 309
  • 337
2
votes
2 answers

Chain meta_search results

How can I chain metasearchs' search method ? @result = User.search(params[:search]).search(params[:filters]) We can call chain method on ActiveRecord like User.active.male.where( age: 14..20) its chaining is possible on meta search's result ?
2
votes
2 answers

how to tell ransack gem to recognize datepicker US format

How to tell ransack gem to translate US format mm/dd/yyyy (deffault from bootstrap datepicker) ? project I'm working on will have several lacales files (UK, US), so UK is simple (just change the datepicker format option) but US format is…
equivalent8
  • 13,754
  • 8
  • 81
  • 109
1
vote
0 answers

MetaSearch Gem - Rails 3.0 working scope methods fail in Rails 3.2

MetaSearch's handy functions such as .not_in worked in Rails 3.0 & 3.1 inside of scope calls. I had to rewrite some scopes to be "plain Rails 3.2" without MetaSearch convenience even though MetaSearch works outside of scope. And it broke several of…
Jason LeMonier
  • 195
  • 1
  • 7
1
vote
1 answer

Rails filter by date with MetaSearch

I have some records which I show in a view. They have start_date and end_date. When I access the view, by default I want it only to show records who's dates are not expired. Expired being defined as: End date and start date <= Now, and End date is…
Sean
  • 2,018
  • 4
  • 25
  • 32
1
vote
0 answers

Meta Search 3 columns as one column

I have three columns in my table product name, product color, and product brand. The table is pretty much static, I just import the data once and it does not get modified. An example would be small car, red, motor co. I want to be able to search for…
cdahllof
  • 21
  • 2
1
vote
1 answer

assign class id to an input field

so there I have this code in rails <%= f.label :year, "Year:" %>
<%= f.text_field :year %>

that returns in html a code like this one < input id="car_year" name="car[year]" size="30" type="text" class="hasDatepicker">
see the…
rmagnum2002
  • 11,341
  • 8
  • 49
  • 86