-
Pratik Khadloya
ruby-on-rails ruby-on-rails-3 meta-search
I am in the process of upgrading my app from Rails2 to Rails3. My Rails2 app uses searchlogic heavily. After googling i’ve come to know that searchlogic is not compatible with Rails3 and need to use meta_search instead. But i havent quite understood the usage of meta_search vis-a-vis searchlogic. If i have a User model with :name and :address fields, i am not able to use the following methods with meta_search. What am i doing wrong? ruby-1.9.2-p0 > User.name_null NoMethodError: undefined
-
Jords
ruby-on-rails meta-search tire
I’m using active_admin and that’s bringing in meta_search to my project. (Which I don’t want to use for anything else).It seems to be defining the search method on all my models, which then means when I include tire, I can’t use it’s search method.There seems to be something strange with how it’s defining the method also – method_defined? says that the search method is not defined, yet when I call it I get the meta_search one. Even if I define my own search method in the class, when I call Docum
-
RainChen
ruby mongoid meta-search
I tried meta_search, but after adding “include MetaSearch::Searches::ActiveRecord” into my model, it raised an error as “undefined method `joins_values'” when run “MyModel.search(params[:search])”I think I dont need full text, so I think following gems are not suitable for my project now:: mongoid_fulltext mongoid-sphinx sunspot_mongoid mongoid_searchI tried a old gem named scoped-search I can make it work for example:get :search do@search = Notification.scoped_search(params[:search]searc
-
Brian W
ruby-on-rails ruby activeadmin meta-search
I’m trying to simply allow filtering of categories on the Locations page for ActiveAdmin.I have three models:class Location < ActiveRecord::Basehas_many :categories_locationshas_many :categories, :through => :categories_locationsclass CategoriesLocation < ActiveRecord::Basebelongs_to :categorybelongs_to :location endclass Category < ActiveRecord::Basehas_many :categories_locationshas_many :locations, :through => :categories_locations endOn my locations page, I’m using this filter:
-
jeremiahishere
kaminari meta-search
I am using Kaminari for pagination and trying to use meta_search for column ordering. I would like my code to look like this:@search = Organization.search(params[:search]) @organizations = @search.page(params[:page])When I write it this way, I am getting the error, undefined method `page’ for #<MetaSearch::Builder:0x7fadb8958630>The solution I have found is this:@search = Organization.search(params[:search]) @organizations = Kaminari.paginate_array(@search.all).page(params[:page]It works
-
jklina
ruby-on-rails ruby-on-rails-3 meta-search scopes
In my Widget model I have the following:scope :accessible_to, lambda { |user|if user.has_role?(‘admin’)self.allelseroles = user.rolesrole_ids = []roles.each { |r| role_ids << r.id }self.joins(:widget_assignments).where(‘widget_assignments.role_id’ => role_ids)end }Ideally, I would like to use this scope as a filter for Ransack’s search results, so in my controller I have:def index@q = Widget.accessible_to(current_user).search(params[:q])@widgets = @q.result.order(‘created_at DESC’) endD
-
ere
ruby-on-rails ruby-on-rails-3 meta-search texticle
I use the active_admin gem which requires the meta_search gem and noticed it conflicts with texticle as they both use the search method and it breaks as a result. I read in a few places about similar problems involving solr where they were able to user an alternative method solr_search but I found no such luck using texticle.NoMethodError (undefined method `relation’ for []:ActiveRecord::Relation):Any ideas how I can avoid this?
-
Geoffrey Hug
ruby-on-rails ruby-on-rails-3 pagination meta-search
I’m trying to paginate my search results from metasearch but I get a undefined method `paginate’ for #<ActiveRecord::Relation:0x6d3df28>This is the code in my controller :@search = Camping.search(params[:search])if !params[:search].nil?@campings = @search.paginate(:page => params[:page]) else@campings = []; endThis should be so simple I really don’t see what’s wrong…I have those in my gem file :gem ‘will_paginate’, ‘3.0.3’ gem ‘bootstrap-will_paginate’, ‘0.0.6’
-
Yasser
ruby-on-rails-3 activeadmin formtastic meta-search
I’ve a table with an integer column called “map_id”, I want to add an activeadmin filter to filter if this column IS NULL or IS NOT NULL.How could this be implemented ?I tried the following filterfilter :map_id, :label => ‘Assigned’, :as => :select, :collection => {:true => nil, :false => ”}But, I get the following error message :undefined method `map_eq’ for #
-
Rafael Oliveira
ruby-on-rails ruby-on-rails-3 meta-search
I’m using fantastic MetaSearch by Ernie, but I’m having an annoying issue.In my application.html.erb I have an search field, just like this one on top of StackOverflow page.<%= form_for @search, :url => vagas_path do |f| %><%= f.text_field :titulo_or_empresa_user_username_contains %><%= f.submit “”, :class => “search-button”, :name => “submit” %> <% end %>The problem is that I don’t have @search initialized in all actions of all controllers, so when I’m not at Va
-
JamesWatling
ruby-on-rails search meta-search
I am working with a rails app and have begun to work on a search function using metasearch but I am having troubles getting the correct method for the search.For example I have a model (Proposal) that has a field cost…model/proposal.rbclass Proposal < ActiveRecord::Base belongs_to :user has_many :users, :through => :invitations attr_accessible :cost, :user_idFor which this code works fine with meta search..views/homes/live_requests.html.erb<%= form_for @search, :url => “/live_reque
-
ndemoreau
ruby-on-rails activerecord meta-search
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 = ?”, params[:id]) if @user.nil?@user = @foundusers.first end unless @user.company_id.nil?@company = Company.find(@user.company_id) endI get following error statement: undefined method `company_id’ for #I dont understand because the query on the database
-
NicdeMor
ruby-on-rails activerecord meta-search
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 = ?”, params[:id]) if @user.nil?@user = @foundusers.first end unless @user.company_id.nil?@company = Company.find(@user.company_id) endI get following error statement: undefined method `company_id’ for #I dont understand because the query on the database
-
Tiago Veloso
ruby-on-rails-3 meta-search
I am working on a rails 3 app, I am trying to use the meta_search gem.After adding the gem to the GemFile and running bundle install, it seems that there is no search method.undefined method `search’ for #<Class:0x00000104134458>I am using something similar to the examples:@search = Bill.search(params[:search]) @bills = @search.allAnyone experienced this before?