ransack Questions
2
Solved
To put simply enough, I'd just like to know if there's a way to set defaults for the sorting functionality using the Ransack gem? ie.
Currently, I have the following when the page loads:
But in...
Schrecklichkeit asked 13/11, 2012 at 22:22
1
Solved
I am using ransack for search and now I want to implement pagination in my rails app. So I am using the will_paginate gem. The issue am facing is that I cant figure out how to put the paginate in m...
Rosenthal asked 21/12, 2015 at 12:11
3
Converting a Rails 2 application to Rails 3, I have to replace the gem searchlogic. Now, using Rails 3.2.8 with the gem Ransack I want to build a search form which uses an existing scope. Example:
...
Asperges asked 18/10, 2012 at 8:6
3
Solved
Let's say I've got User class with an :email field. And let's say I'm using activeadmin to manage Users.
Making a filter that returns emails that match one string, e.g. "smith", is very simple. In...
Podiatry asked 23/10, 2015 at 19:9
3
Solved
I'm using Ransack to allow advanced searching on my users. Currently, the users have first_name, middle_name, and last_name columns. Here is my code:
.field
= f.attribute_fields do |a|
= a.attri...
Bygone asked 9/11, 2012 at 13:32
0
I have a Rails 4.2 app in which I'm using Ransack mixed with Geocoder for search. I want to use an Ajax (remote: true) for my search to avoid pageloads and changing of the URL.
When I implement th...
Bifilar asked 9/8, 2015 at 14:12
0
I have two models with has_one and belongs_to associations. I want to sort the model with has_one depending on whether the associated object exists.
I can currently sort for example by associated ...
Pitcher asked 1/7, 2015 at 9:9
2
Just started using Ransack and i'm loving it. But desperate to know how to start with a blank index, with no results? forcing the user to use the search form. Here what the controller looks like so...
Pulchia asked 3/3, 2014 at 23:3
1
I am using Ransack Gem and doing a count sort via counter cache. My attribute is an integer.
I am calling it like this:
<%= sort_link(@q, :people_count, "PEOPLE") %>
The sort outpu...
Diaphane asked 26/1, 2015 at 13:50
1
Solved
I need to create a custom ActiveAdmin filter for a Date Range which belongs to another resource. I want to filter a list of users by a date range of when they completed a survey.
I've declared a ...
Middy asked 30/9, 2014 at 8:26
0
(This is a more specified version of the question that I asked previously but that has not received any answers; I hope it's not against SO’s rules)
Given that I have a Rails 4 app that has a Spon...
Septemberseptembrist asked 29/12, 2014 at 1:16
0
In a Ruby on Rails app that heavily relies on ActiveAdmin, I have a Sponsor model, which is associated with a Sponsorship model. One sponsor can sponsor many children, so one sponsor can have many ...
Hufuf asked 26/12, 2014 at 23:29
1
Solved
I have a project on Ruby on Rails 4.1.4, using activeadmin 1.0.0.pre from git://github.com/activeadmin/activeadmin, pg 0.17.1, PostgreSQL 9.3
In the project I have these models:
class User
has...
Magnanimous asked 23/11, 2014 at 21:32
1
I have the following model
class Position < ActiveRecord::Base
belongs_to :position_name
delegate :name, to: :position_name
And this search form
= search_form_for @search, url: '#', meth...
Michael asked 23/4, 2013 at 13:33
1
Solved
I have a ransack search form:
<h1>Scheduled Payments</h1>
<%= search_form_for [:admin, @search] do |form| %>
<%= form.text_field :start_date_gteq, value: @order_date_gteq_w...
Gastrin asked 17/7, 2014 at 19:34
2
Solved
I'm trying to add a custom filter to ActiveAdmin which is powered by Ransack these days. Unfortunately, ransacker is not documented at all and from the few resources online I fumbled together the f...
Differentiate asked 18/3, 2014 at 7:57
1
Solved
I have a Rails 4.0.1 application, using gems activeadmin 1.0.0.pre and ransack 1.1.0.
Using ActiveAdmin, I have many errors like this one :
NoMethodError in Admin::MyModel#action
Showing [...]/v...
Langill asked 11/2, 2014 at 16:50
2
Solved
I am loving the ransack gem for its flexibility, however I am unable to get the standard collection_select to function properly. Perhaps someone can assist.
Example:
<%= collection_select(:ex...
Cultivated asked 19/12, 2012 at 18:45
1
Solved
I want to make a search for all fields that are NULL or have the value of -1 using ransack.
search({:param_name_null => 1 })
will give the nulls
search({:param_name_is_any => -1 })
wil...
Cutcliffe asked 14/5, 2013 at 9:34
3
Solved
First of all, I'm new to RoR, so the answer may be obvious, in which case I apologize. I've looked around and haven't found anything that helps.
I'm trying to have a search form at the header of e...
Handmaid asked 9/5, 2012 at 20:24
2
Is HABTM supported by Ransack?
Having the models:
Shop HABTM Categories
Category HABTM Shops
Can I use ransack to search a Shop by a single category?
What does the form look like?
Keynesianism asked 23/7, 2012 at 19:33
2
Solved
I'm using Ransack's sort_link in my rails project to display a list of fees for my payment model. However, 'fee_amount' isn't an attribute of the payment model, but instead a class method of the bi...
Sublapsarianism asked 1/10, 2012 at 14:41
1
Solved
I have a search form in the header of my app and I would like to use this search form to search through multiple models within the application.
For example a request like /search?q=rails should tr...
Trounce asked 27/5, 2013 at 14:20
1
Solved
I'm new to Ruby on Rails, and I'm creating my first site. I have a user model with 3 columns: firstname, lastname and email. Im using ransack to make a search engine, and i want to have one search ...
Embrey asked 14/3, 2013 at 13:24
1
Solved
Say for example I have an event with start_date and length (as integer representing days).
In the model I define end_date as start_date + length.days very simply as you would expect:
def end_date...
Batt asked 7/3, 2013 at 0:44
© 2022 - 2024 — McMap. All rights reserved.