administrate_ransack 0.1.13 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30740fba6ba03d609c74a19fcce57700128abb8055735eb6e341ff445881b076
4
- data.tar.gz: 1b040d838cb34725d8a654a6cf7376132e81e34a0a48107501ad175a9da06518
3
+ metadata.gz: 53f9b7117bb0a7ddf959ed0d6e6e054e781cbb50904e076ecba27790f221d2c0
4
+ data.tar.gz: dbc0c054f730be1b2b6479e8fa4e72a55d0adf0d9f1f46c3143606700289e9ae
5
5
  SHA512:
6
- metadata.gz: 157edfd6f4bb409bdac2394f815246e6e3b940bc5709c7d2a1cea3270c5ee71f8ae50f0a6d982765a3465473af778dd4034d7bc3a9ba40580269ae821c522a9c
7
- data.tar.gz: 8af8b11b461b4d23db7acbed9663ed21c65a3e18f300cc81ecc85269e332fe63cb7fc98a8435a4732e19fb7842d027964c537b646599830a428d765208821ce4
6
+ metadata.gz: bd13d31b54c05bacbc172eb81871044ab80e9fe1f5182fcdb20e7c4ef96245e3f95be05753abd5b7e7f5cd99367545530b992242d1845b6d4e9dea592d40862f
7
+ data.tar.gz: 0befebe036ae09c3336bfd214ae904acb6bfc773d4fe16dbdb89ed5248d36d921616e4b526a7e9c1bbfd430106f3830588be79786d67d64b55b19782bb5da9ec
data/README.md CHANGED
@@ -1,12 +1,18 @@
1
- # Administrate Ransack [![Gem Version](https://badge.fury.io/rb/administrate_ransack.svg)](https://badge.fury.io/rb/administrate_ransack) [![CircleCI](https://circleci.com/gh/blocknotes/administrate_ransack.svg?style=svg)](https://circleci.com/gh/blocknotes/administrate_ransack)
1
+ # Administrate Ransack
2
+ [![gem version](https://badge.fury.io/rb/administrate_ransack.svg)](https://badge.fury.io/rb/administrate_ransack)
3
+ [![gem downloads](https://badgen.net/rubygems/dt/administrate_ransack)](https://rubygems.org/gems/administrate_ransack)
4
+ [![linters](https://github.com/blocknotes/administrate_ransack/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/administrate_ransack/actions/workflows/linters.yml)
5
+ [![specs](https://github.com/blocknotes/administrate_ransack/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/administrate_ransack/actions/workflows/specs.yml)
6
+
2
7
  A plugin for [Administrate](https://github.com/thoughtbot/administrate) to use [Ransack](https://github.com/activerecord-hackery/ransack) for filtering resources.
3
8
 
4
9
  Features:
5
10
  - add Ransack search results using module prepend inside an Administrate controller;
6
- - offer a filters side bar based on the resource's attributes;
11
+ - offer a filters partial based on the resource's attributes;
7
12
  - customize searchable attributes.
8
13
 
9
14
  ## Installation
15
+
10
16
  - After installing Administrate, add to *Gemfile*: `gem 'administrate_ransack'` (and execute `bundle`)
11
17
  - Edit your admin resource controller adding inside the class body:
12
18
  ```rb
@@ -16,16 +22,19 @@ prepend AdministrateRansack::Searchable
16
22
  ```erb
17
23
  <%= render('administrate_ransack/filters') %>
18
24
  ```
19
- - See the Customizations section to change the attributes list
25
+ - See the Usage section for extra options
20
26
 
21
27
  ## Usage
28
+
22
29
  - The filters partial accepts some optional parameters:
23
30
  + `attribute_labels`: hash used to override the field labels, ex. `{ title: "The title" }`
24
31
  + `attribute_types`: hash used to specify the filter fields, ex. `{ title: Administrate::Field::String }`
25
32
  + `search_path`: the path to use for searching (form URL)
26
- - For associations (has many/belongs to) the label used can be customized adding an `admin_label` method to the target model which returns a string while the collection can by filtered with `admin_scope`. Example:
33
+ + `namespace`: the namespace used by Administrate, ex. `:supervisor`
34
+ - For associations (_has many_/_belongs to_) the label used can be customized adding an `admin_label` method to the target model which returns a string while the collection can by filtered with `admin_scope`. Example:
27
35
 
28
36
  ```rb
37
+ # Sample post model
29
38
  class Post < ApplicationRecord
30
39
  scope :admin_scope, -> { where(published: true) }
31
40
 
@@ -35,14 +44,33 @@ class Post < ApplicationRecord
35
44
  end
36
45
  ```
37
46
 
38
- ## Notes
39
- - Administrate Search logic works independently from Ransack searches, I suggest to disable it eventually (ex. overriding `show_search_bar?` in the controller)
40
- - Ordering by clicking on the headers of the table preserving the Ransack searches requires a change to the headers links, replacing the th links of *_collection* partial with:
47
+ - To use scopes in filters it's needed to update also the `ransackable_scopes` in the model, example:
48
+
41
49
  ```rb
42
- sort_link(@ransack_results, attr_name) do
43
- # ...
50
+ # Sample post model
51
+ class Post < ApplicationRecord
52
+ scope :recents, ->(dt = 1.month.ago) { where('dt > ?', dt).order(dt: :desc) }
53
+ scope :by_category, ->(category) { where(category: category) }
54
+
55
+ class << self
56
+ def ransackable_scopes(_auth_object = nil)
57
+ %i[by_category recents]
58
+ end
59
+ end
44
60
  end
45
61
  ```
62
+
63
+ ```erb
64
+ <!-- Sample index view -->
65
+ <%= render(
66
+ 'administrate_ransack/filters',
67
+ attribute_types: { recents: Administrate::Field::DateTime, by_category: Administrate::Field::String }
68
+ ) %>
69
+ ```
70
+
71
+ ## Notes
72
+
73
+ - Administrate Search logic works independently from Ransack searches, I suggest to disable it eventually (ex. overriding `show_search_bar?` in the controller or removing the bar from the view)
46
74
  - Date/time filters use Rails `datetime_field` method which produces a `datetime-local` input field, at the moment this type of element is not broadly supported, a workaround is to include [flatpickr](https://github.com/flatpickr/flatpickr) datetime library.
47
75
  + This gem checks if `flatpickr` function is available in the global scope and applies it to the `datetime-local` filter inputs;
48
76
  + you can include the library using your application assets or via CDN, ex. adding to **app/views/layouts/admin/application.html.erb**:
@@ -57,7 +85,8 @@ end
57
85
  ```
58
86
 
59
87
  ## Customizations
60
- - Sample with different options provided:
88
+
89
+ - Sample call of the filters partial with different options provided:
61
90
  ```erb
62
91
  <%
63
92
  # In alternative prepare an hash in the dashboard like RANSACK_TYPES = {}
@@ -78,11 +107,15 @@ attribute_labels = {
78
107
  search_path: admin_root_path
79
108
  ) %>
80
109
  ```
81
- - An alternative is to prepare some hashes constants in the dashboard (ex. `RANSACK_TYPES`) and then:
110
+ - Another option is to prepare some hashes constants in the dashboard (ex. `RANSACK_TYPES`):
82
111
  ```erb
83
112
  <%= render('administrate_ransack/filters', attribute_types: @dashboard.class::RANSACK_TYPES) %>
84
113
  ```
85
- - Optional basic style to setup the filters as a sidebar:
114
+
115
+ ## Sample styles
116
+
117
+ - Some basic style to setup the filters as a sidebar (see the screenshot below):
118
+
86
119
  ```css
87
120
  .main-content__body {
88
121
  display: inline-block;
@@ -107,34 +140,70 @@ attribute_labels = {
107
140
  ```
108
141
 
109
142
  Screenshot:
110
- ![screenshot](screenshot.png)
143
+ ![screenshot](extra/screenshot.png)
144
+
145
+ - Alternative styles for an horizontal search bar:
146
+
147
+ ```css
148
+ [data-administrate-ransack-filters] {
149
+ border: 1px solid #ddd;
150
+ padding: 10px;
151
+ text-align: center;
152
+ }
153
+
154
+ [data-administrate-ransack-filters] .filters {
155
+ display: inline-block;
156
+ }
157
+
158
+ [data-administrate-ransack-filters] .filter, [data-administrate-ransack-filters] .filter > label {
159
+ display: inline-block;
160
+ }
161
+
162
+ [data-administrate-ransack-filters] .filter > input {
163
+ display: inline-block;
164
+ width: auto;
165
+ }
166
+
167
+ [data-administrate-ransack-filters] .filters-buttons {
168
+ display: inline-block;
169
+ margin-left: 20px;
170
+ }
171
+ ```
172
+
173
+ Screenshot:
174
+ ![screenshot2](extra/screenshot2.png)
111
175
 
112
176
  ## Extra notes
113
- - If you need to define custom search logics you can skip prepending the module (`AdministrateRansack::Searchable`) and create your own search query in a controller, ex:
177
+
178
+ - If you need to define custom search logics you can skip prepending the module (`AdministrateRansack::Searchable`) and create your own search query in a controller (but you need to assign the Ransack search object to `@ransack_results` for the filters partial), for example:
114
179
  ```ruby
115
180
  def scoped_resource
116
181
  @ransack_results = super.ransack(params[:q])
117
182
  @ransack_results.result(distinct: true)
118
183
  end
119
184
  ```
120
- - Sometimes it's easier to create a new ransack field than overriding the search logic, example to search in a `jsonb` field adding to a Post model:
185
+ - Sometimes it's easier to create a new Ransack field than overriding the search logic (there are a lot of good examples in the [Ransack Wiki](https://github.com/activerecord-hackery/ransack/wiki/Using-Ransackers)), example to search in a `jsonb` field adding to a Post model:
121
186
  ```ruby
122
187
  ransacker :keywords do
123
188
  Arel.sql("posts.metadata ->> 'keywords'")
124
189
  end
125
190
  ```
126
- - With this component you can easily link another resource applying some filters, example to add in a tag show page the link to the related posts:
191
+ - With Administrate Ransack you can easily create links to other resources applying some filters, example to add in a tag show page the link to the related posts:
127
192
  ```erb
128
193
  <%= link_to("Tag's posts", admin_posts_path('q[tags_id_in][]': page.resource.id), class: "button") %>
129
194
  ```
130
195
 
131
196
  ## Do you like it? Star it!
197
+
132
198
  If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
133
199
 
134
200
  Or consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).
135
201
 
136
202
  ## Contributors
203
+
137
204
  - [Mattia Roccoberton](https://blocknot.es/): author
205
+ - The good guys that opened issues and pull requests from time to time
138
206
 
139
207
  ## License
208
+
140
209
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -14,75 +14,51 @@
14
14
  attribute_labels ||= {}
15
15
  attribute_types ||= @dashboard.attribute_types.select { |key, _value| @dashboard.collection_attributes.include?(key) }
16
16
  form_options = { html: { 'data-administrate-ransack-filters': '1' } }
17
+ namespace = local_assigns[:namespace] || :admin
17
18
  if local_assigns.has_key?(:search_path)
18
19
  form_path = @ransack_results
19
20
  form_options[:url] = search_path
20
21
  clear_filters_path = search_path
21
22
  else
22
- form_path = [:admin, @ransack_results]
23
- clear_filters_path = url_for(url_for([:admin, @ransack_results.klass]))
23
+ form_path = [namespace, @ransack_results]
24
+ clear_filters_path = url_for(url_for([namespace, @ransack_results.klass]))
24
25
  end
25
26
  %>
27
+
26
28
  <%= search_form_for form_path, form_options do |f| %>
27
29
  <div class="filters">
28
30
  <% attribute_types.each do |field, type| %>
29
31
  <% next if field == :id %>
30
32
 
31
- <div class="filter">
32
- <% input_type = type.is_a?(Administrate::Field::Deferred) ? type.deferred_class.to_s : type.to_s %>
33
+ <% label = attribute_labels.include?(field) ? attribute_labels[field] : field %>
34
+ <% model = @ransack_results.klass %>
35
+ <% input_type = type.is_a?(Administrate::Field::Deferred) ? type.deferred_class.to_s : type.to_s %>
36
+ <div class="filter <%= input_type.parameterize %>">
33
37
  <% case input_type %>
34
38
  <% when 'Administrate::Field::BelongsTo' %>
35
- <% association = @ransack_results.klass.reflections[field.to_s] %>
36
- <% if association %>
37
- <% label = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
38
- <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
39
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
40
- <%= f.collection_select "#{field}_id_eq", collection, :id, label, include_blank: true %>
41
- <% end %>
39
+ <% association = model.reflections[field.to_s] %>
40
+ <%= render 'administrate_ransack/components/field_belongs_to', form: f, model: model, field: field, label: label, association: association %>
42
41
  <% when 'Administrate::Field::Boolean' %>
43
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
44
- <%= f.select "#{field}_eq", [[t('administrate_ransack.filters.no'), false], [t('administrate_ransack.filters.yes'), true]], include_blank: true %>
42
+ <%= render 'administrate_ransack/components/field_boolean', form: f, model: model, field: field, label: label %>
45
43
  <% when 'Administrate::Field::Date' %>
46
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
47
- <%= f.date_field "#{field}_gteq" %>
48
- <%= f.date_field "#{field}_lteq" %>
44
+ <%= render 'administrate_ransack/components/field_date', form: f, model: model, field: field, label: label %>
49
45
  <% when 'Administrate::Field::DateTime' %>
50
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
51
- <%= f.datetime_field "#{field}_gteq" %>
52
- <%= f.datetime_field "#{field}_lteq" %>
46
+ <%= render 'administrate_ransack/components/field_datetime', form: f, model: model, field: field, label: label %>
53
47
  <% when 'Administrate::Field::Email', 'Administrate::Field::String', 'Administrate::Field::Text' %>
54
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
55
- <%= f.search_field "#{field}_cont" %>
48
+ <%= render 'administrate_ransack/components/field_string', form: f, model: model, field: field, label: label %>
56
49
  <% when 'Administrate::Field::Number' %>
57
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
58
- <%= f.number_field "#{field}_eq" %>
50
+ <%= render 'administrate_ransack/components/field_number', form: f, model: model, field: field, label: label %>
59
51
  <% when 'Administrate::Field::HasMany' %>
60
- <% association = @ransack_results.klass.reflections[field.to_s] %>
61
- <% if association %>
62
- <% label = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
63
- <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
64
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
65
- <%= f.collection_check_boxes "#{field}_id_in", collection, :id, label do |b| %>
66
- <%= b.label do %>
67
- <%= b.check_box %>
68
- <span><%= b.object.send(label) %></span>
69
- <% end %>
70
- <% end %>
71
- <% end %>
52
+ <% association = model.reflections[field.to_s] %>
53
+ <%= render 'administrate_ransack/components/field_has_many', form: f, model: model, field: field, label: label, association: association %>
72
54
  <% when 'Administrate::Field::Select' %>
73
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
74
- <%= f.select "#{field}_eq", type.options[:collection], include_blank: true %>
55
+ <%= render 'administrate_ransack/components/field_select', form: f, model: model, field: field, label: label, type: type %>
75
56
  <% else %>
76
- <!-- unsupported Field::HasOne -->
77
- <!-- unsupported Field::Polymorphic -->
78
- <!-- unsupported Field::Password -->
57
+ <%= render 'administrate_ransack/components/field_other', form: f, model: model, field: field, label: label, type: type %>
79
58
  <% end %>
80
59
  </div>
81
60
  <% end %>
82
61
  </div>
83
62
 
84
- <div class="filters-buttons">
85
- <%= f.submit %>
86
- <%= link_to t('administrate_ransack.filters.clear_filters'), clear_filters_path, class: 'btn-clear-filters' %>
87
- </div>
63
+ <%= render 'administrate_ransack/components/filter_buttons', form: f, clear_filters_path: clear_filters_path %>
88
64
  <% end %>
@@ -0,0 +1,7 @@
1
+ <% if association %>
2
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_id_eq" %>
3
+ <% desc = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
4
+ <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
5
+ <%= form.label(label) %>
6
+ <%= form.collection_select(field_key, collection, :id, desc, include_blank: true) %>
7
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_eq" %>
2
+ <% values = [[t('administrate_ransack.filters.no'), false], [t('administrate_ransack.filters.yes'), true]] %>
3
+ <%= form.label(label) %>
4
+ <%= form.select(field_key, values, include_blank: true) %>
@@ -0,0 +1,7 @@
1
+ <%= form.label(label) %>
2
+ <% if model.ransackable_scopes.include?(field) %>
3
+ <%= form.date_field(field, value: form.object.send(field)) %>
4
+ <% else %>
5
+ <%= form.date_field("#{field}_gteq") %>
6
+ <%= form.date_field("#{field}_lteq") %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= form.label(label) %>
2
+ <% if model.ransackable_scopes.include?(field) %>
3
+ <%= form.datetime_field(field, value: form.object.send(field)) %>
4
+ <% else %>
5
+ <%= form.datetime_field("#{field}_gteq") %>
6
+ <%= form.datetime_field("#{field}_lteq") %>
7
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% if association %>
2
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_id_in" %>
3
+ <% desc = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
4
+ <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
5
+ <%= form.label(label) %>
6
+ <%= form.collection_check_boxes(field_key, collection, :id, desc) do |b| %>
7
+ <%= b.label do %>
8
+ <%= b.check_box %>
9
+ <span><%= b.object.send(desc) %></span>
10
+ <% end %>
11
+ <% end %>
12
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_eq" %>
2
+ <%= form.label(label) %>
3
+ <%= form.number_field(field_key) %>
@@ -0,0 +1,6 @@
1
+ <%= form.label(label) %>
2
+ <%= form.search_field(field) %>
3
+
4
+ <!-- unsupported Field::HasOne -->
5
+ <!-- unsupported Field::Polymorphic -->
6
+ <!-- unsupported Field::Password -->
@@ -0,0 +1,3 @@
1
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_eq" %>
2
+ <%= form.label(label) %>
3
+ <%= form.select(field_key, type.options[:collection] || [], include_blank: true) %>
@@ -0,0 +1,3 @@
1
+ <% field_key = model.ransackable_scopes.include?(field) ? field : "#{field}_cont" %>
2
+ <%= form.label(label) %>
3
+ <%= form.search_field(field_key) %>
@@ -0,0 +1,4 @@
1
+ <div class="filters-buttons">
2
+ <%= form.submit t('administrate_ransack.filters.search'), name: nil %>
3
+ <%= link_to t('administrate_ransack.filters.clear_filters'), clear_filters_path, class: 'btn-clear-filters' %>
4
+ </div>
@@ -3,4 +3,5 @@ en:
3
3
  filters:
4
4
  'clear_filters': Clear filters
5
5
  'no': 'No'
6
+ 'search': Search
6
7
  'yes': 'Yes'
@@ -8,5 +8,20 @@ module AdministrateRansack
8
8
  @ransack_results = super.ransack(params[:q])
9
9
  @ransack_results.result(distinct: true)
10
10
  end
11
+
12
+ # ref => https://github.com/thoughtbot/administrate/blob/v0.15.0/app/helpers/administrate/application_helper.rb#L54-L60
13
+ def sanitized_order_params(page, current_field_name)
14
+ collection_names = page.item_includes + [current_field_name]
15
+ association_params = collection_names.map do |assoc_name|
16
+ { assoc_name => %i[order direction page per_page] }
17
+ end
18
+ params.permit(:search, :id, :page, :per_page, association_params, q: {})
19
+ end
20
+
21
+ class << self
22
+ def prepended(base)
23
+ base.helper_method :sanitized_order_params
24
+ end
25
+ end
11
26
  end
12
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdministrateRansack
4
- VERSION = '0.1.13'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate_ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-21 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -38,161 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.3'
41
- - !ruby/object:Gem::Dependency
42
- name: activestorage
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '6.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '6.0'
55
- - !ruby/object:Gem::Dependency
56
- name: capybara
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.33'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.33'
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.13'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.13'
83
- - !ruby/object:Gem::Dependency
84
- name: puma
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '4.3'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '4.3'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec_junit_formatter
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.4'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.4'
111
- - !ruby/object:Gem::Dependency
112
- name: rspec-rails
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '4.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '4.0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '0.90'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '0.90'
139
- - !ruby/object:Gem::Dependency
140
- name: sassc
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '2.4'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '2.4'
153
- - !ruby/object:Gem::Dependency
154
- name: selenium-webdriver
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '3.142'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '3.142'
167
- - !ruby/object:Gem::Dependency
168
- name: sprockets-rails
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '3.2'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '3.2'
181
- - !ruby/object:Gem::Dependency
182
- name: sqlite3
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '1.4'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '1.4'
195
- description: A plugin for Administrate to use Ransack for filtering resources
41
+ description: A plugin for Administrate to use Ransack for search filters
196
42
  email:
197
43
  - mat@blocknot.es
198
44
  executables: []
@@ -203,6 +49,16 @@ files:
203
49
  - README.md
204
50
  - Rakefile
205
51
  - app/views/administrate_ransack/_filters.html.erb
52
+ - app/views/administrate_ransack/components/_field_belongs_to.html.erb
53
+ - app/views/administrate_ransack/components/_field_boolean.html.erb
54
+ - app/views/administrate_ransack/components/_field_date.html.erb
55
+ - app/views/administrate_ransack/components/_field_datetime.html.erb
56
+ - app/views/administrate_ransack/components/_field_has_many.html.erb
57
+ - app/views/administrate_ransack/components/_field_number.html.erb
58
+ - app/views/administrate_ransack/components/_field_other.html.erb
59
+ - app/views/administrate_ransack/components/_field_select.html.erb
60
+ - app/views/administrate_ransack/components/_field_string.html.erb
61
+ - app/views/administrate_ransack/components/_filter_buttons.html.erb
206
62
  - config/locales/en.yml
207
63
  - lib/administrate_ransack.rb
208
64
  - lib/administrate_ransack/engine.rb