ransack Questions

4

Solved

I've got a table, 'jobs' with a enum field 'status'. status has the following enum set: enum status: [ :draft, :active, :archived ] using ransack, how do I filter the table for, say, all active...
Letty asked 16/5, 2016 at 15:41

3

Solved

I'm trying to export a list of Ransack (Railscast) results to a CSV file (Railcast). However, it keeps exporting all of the objects, instead of the results returned by the Ransack search. Can anyon...
Pinnate asked 7/6, 2013 at 15:2

2

Using the 'eq' predicate with a blank value, Ransack will cancel out that predicate. Which is obviously handy to have an "All" option in your select. But what if I want to add an option in my &lt...
Fleshings asked 11/9, 2013 at 0:18

3

I have an app that uses the Ransack gem and I'm converting it from Mysql to Postgres. In an instance where the sort column is from an associated table and the distinct option is set to true, Postg...
Apothecary asked 3/11, 2013 at 1:38

1

How can I implement the equivalent of :name_eq_or_description_cont, which combines _eq and _cont predicates into the same search key, so that I can create a search field in the form as: <%= sea...
Fatshan asked 12/1, 2015 at 19:16

4

Solved

I've been wracking my brain over this but can't get it. I feel like the answer is probably obvious. What I'm trying to do is the following: I have an index controller which lists a series of Jobs...
Davon asked 8/11, 2012 at 7:8

6

Solved

Hi i am using ransack + kalendae_assets gem for searching records in between start date and end date for this i am using ransack PREDICATES by referring https://github.com/ernie/ransack/blob/maste...

2

Solved

I'm using ransack gem for searching in rails application. I need to search an array of email_ids in User table. Referring to this issue at ransacking, I followed the steps and added this to the in...
Ulster asked 16/7, 2016 at 10:14

2

Solved

I was getting this error Controller def index @q = JobSubmission.ransack(search_params[:q]) @job_submissions = @q.result(distinct: true) @job_submissions = @job_submissions.page(params[:page]).p...
Streetlight asked 1/10, 2020 at 5:21

5

Solved

A basic questión, but I couldn't find something clear in the project page or the wiki. I have the following code: field = "secre" Position.search( {:description_cont => field, :code_cont => ...
Hamper asked 17/10, 2012 at 18:12

4

I have a field as json column and i have to search all the phone values inside that column, i have searched for it and i have not found any document using ransack. Is it possible to use ransaack to...
Lefkowitz asked 9/7, 2016 at 2:57

0

According to Ransack documentation, there is a possibility to pass custom arguments to a ransacker method: class Person < ApplicationRecord ransacker :author_max_title_of_article_where_body_le...
Dessiatine asked 19/7, 2019 at 21:35

2

So I put quite a bit of time to write this query, and then found out the hard way that this is returning an array rather than an activerecord relation. DOH. This wouldn't be a problem, but i need t...
Misology asked 12/12, 2018 at 0:37

3

Like carvil I have in my model a datetime for created_at although I wanted the "equals" predicate to compare the created_at and a date (like '2012-09-26'). So I added in my model (in order to add ...
Putup asked 26/9, 2012 at 15:43

2

How do I make Rails time select to show only the hour part without the minutes? Basically what I want is to show a time filter with start_time and end_time and use Ransack gem to filter the query. ...
Frankforter asked 23/6, 2015 at 16:43

2

Solved

I have to perform a search on a database using ransack. A few columns in the database have data stored in serialized arrays. I want to match the exact data stored in the arrays with data sent by us...
Eloiseloisa asked 14/3, 2018 at 9:39

2

Solved

I have a HABTM relationship between the Theme and Quote models. The themes index view displays the count of quotes associated with each theme. I'd like to add a Ransack sort_link on that column, so...
Trajan asked 1/2, 2017 at 16:36

2

Using Railscast and Ransack demo code, I am able to build Advanced Search like this The drop down "all/any" comes from <%= f.combinator_select %> and it works but I need Conditional Groups wi...

1

I am using advanced search in Ransack which has default AND. I have made it as OR by putting .try(:merge, m: 'or')) @search = Data.search(params[:q].try(:merge, m: 'or')) but I am not able to ge...
Outfall asked 16/12, 2016 at 10:44

3

I have a boolean attribute (published) in my model book and I wish to filter all books using checkboxes on that value. class Book < ActiveRecord::Base attr_accessible :published end That mea...
Ligure asked 5/7, 2013 at 13:49

1

I`ve got a model with several taxonomies using acts-as-taggable-on class Film < ActiveRecord::Base attr_accessible :mood_list, :genre_list, :tag_list, :country_list acts_as_taggable_on :count...

1

I have a recipe model which has_many ingredients and each ingredient belongs to an item. In my advanced search form, I would like a user to select multiple ingredients and let Ransack find a recipe...
Globe asked 17/11, 2015 at 21:35

2

Solved

I am currently experimenting using the ransack gem to conduct a search on a model in Rails. As it stands I am using the basic setup. Controller: def index @q = Person.search(params[:q]) @people...
Locke asked 25/3, 2013 at 9:47

1

I'd like to use ransack (via ActiveAdmin) to do full-text searches on a model. How can I get ransack to use pg_search for its query? I want to run queries that, among other query components, use ...
Agger asked 3/8, 2015 at 16:20

2

first time poster. I am trying to sort a table of users using the Ransack gem and Kaminari for pagination. When I use name, id, etc. sorting works but when I try an association with posts_count, so...
Kareem asked 22/8, 2012 at 2:26

© 2022 - 2024 — McMap. All rights reserved.