administrate_ransack 0.1.10 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2dde6b1bd570497e553c4e737f4b48654af8470dfbe733c6e35a3bb74991b6e
4
- data.tar.gz: e8fcfe208ba7ebc128ccfee07f816da649aa7a8ac0ab35e180e06832af070391
3
+ metadata.gz: 07d7f30c351a3488f7eb7f2ba5c21ed52d1a935fc895070026af20209883d48f
4
+ data.tar.gz: 07b89a2beba6bdf5d6c59f17c100c70c7a90d73f85b3260715ba4b1641d566b4
5
5
  SHA512:
6
- metadata.gz: 5581bf2209ae91bb8b9b43ffe96be8cecbceadb22d0b0db05755c20443fd6b17ddfcbf70f500442c94c6bf05f4ad31ef3bb9243e3336b9f642b7ac4de4a520b0
7
- data.tar.gz: cf69dfe636379448c07b703fbf1435f47fdfeb234b15683414215d756132277d8c1b80e7832e8c16fea2fbd1d0ee0e6a904ccde85d43ddcc0409133e6b8da278
6
+ metadata.gz: c87a21c626b2553f8659740e785c5a7f893b35d021dc483d70d75ada047b729f8a04fcafaf95236f8dae55f25f61fc95a558580ae89bd68d68f520892ff303ee
7
+ data.tar.gz: a7040f799122eb75d22e1af2d24c86a84c51c5da6001219cf8ba67fa861b59f2a772fae3a13cfeb9cbaa4e1d3517c754e241723993bc5603ee68f23f409ec74c
data/README.md CHANGED
@@ -1,12 +1,14 @@
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 [![Gem Version](https://badge.fury.io/rb/administrate_ransack.svg)](https://badge.fury.io/rb/administrate_ransack) [![Specs](https://github.com/blocknotes/administrate_ransack/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/administrate_ransack/actions/workflows/specs.yml)
2
+
2
3
  A plugin for [Administrate](https://github.com/thoughtbot/administrate) to use [Ransack](https://github.com/activerecord-hackery/ransack) for filtering resources.
3
4
 
4
5
  Features:
5
6
  - add Ransack search results using module prepend inside an Administrate controller;
6
- - offer a filters side bar based on the resource's attributes;
7
+ - offer a filters partial based on the resource's attributes;
7
8
  - customize searchable attributes.
8
9
 
9
10
  ## Installation
11
+
10
12
  - After installing Administrate, add to *Gemfile*: `gem 'administrate_ransack'` (and execute `bundle`)
11
13
  - Edit your admin resource controller adding inside the class body:
12
14
  ```rb
@@ -16,13 +18,18 @@ prepend AdministrateRansack::Searchable
16
18
  ```erb
17
19
  <%= render('administrate_ransack/filters') %>
18
20
  ```
19
- - See the Customizations section to change the attributes list
21
+ - See the Usage section for extra options
20
22
 
21
23
  ## Usage
22
- 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`.
23
24
 
24
- Example:
25
+ - The filters partial accepts some optional parameters:
26
+ + `attribute_labels`: hash used to override the field labels, ex. `{ title: "The title" }`
27
+ + `attribute_types`: hash used to specify the filter fields, ex. `{ title: Administrate::Field::String }`
28
+ + `search_path`: the path to use for searching (form URL)
29
+ - 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:
30
+
25
31
  ```rb
32
+ # Sample post model
26
33
  class Post < ApplicationRecord
27
34
  scope :admin_scope, -> { where(published: true) }
28
35
 
@@ -32,14 +39,33 @@ class Post < ApplicationRecord
32
39
  end
33
40
  ```
34
41
 
35
- ## Notes
36
- - Administrate Search logic works independently from Ransack searches, I suggest to disable it eventually (ex. overriding `show_search_bar?` in the controller)
37
- - 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:
42
+ - To use scopes in filters it's needed to update also the `ransackable_scopes` in the model, example:
43
+
38
44
  ```rb
39
- sort_link(@ransack_results, attr_name) do
40
- # ...
45
+ # Sample post model
46
+ class Post < ApplicationRecord
47
+ scope :recents, ->(dt = 1.month.ago) { where('dt > ?', dt).order(dt: :desc) }
48
+ scope :by_category, ->(category) { where(category: category) }
49
+
50
+ class << self
51
+ def ransackable_scopes(_auth_object = nil)
52
+ %i[by_category recents]
53
+ end
54
+ end
41
55
  end
42
56
  ```
57
+
58
+ ```erb
59
+ <!-- Sample index view -->
60
+ <%= render(
61
+ 'administrate_ransack/filters',
62
+ attribute_types: { recents: Administrate::Field::DateTime, by_category: Administrate::Field::String }
63
+ ) %>
64
+ ```
65
+
66
+ ## Notes
67
+
68
+ - 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)
43
69
  - 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.
44
70
  + This gem checks if `flatpickr` function is available in the global scope and applies it to the `datetime-local` filter inputs;
45
71
  + you can include the library using your application assets or via CDN, ex. adding to **app/views/layouts/admin/application.html.erb**:
@@ -54,9 +80,11 @@ end
54
80
  ```
55
81
 
56
82
  ## Customizations
57
- - Allow only some fields for the filters in the index view:
83
+
84
+ - Sample call of the filters partial with different options provided:
58
85
  ```erb
59
86
  <%
87
+ # In alternative prepare an hash in the dashboard like RANSACK_TYPES = {}
60
88
  attribute_types = {
61
89
  title: Administrate::Field::String,
62
90
  author: Administrate::Field::BelongsTo,
@@ -70,10 +98,15 @@ attribute_labels = {
70
98
  <%= render(
71
99
  'administrate_ransack/filters',
72
100
  attribute_types: attribute_types,
73
- attribute_labels: attribute_labels
101
+ attribute_labels: attribute_labels,
102
+ search_path: admin_root_path
74
103
  ) %>
75
104
  ```
76
- - Optional basic style to setup the filters as a sidebar:
105
+ - Another option is to prepare some hashes constants in the dashboard (ex. `RANSACK_TYPES`):
106
+ ```erb
107
+ <%= render('administrate_ransack/filters', attribute_types: @dashboard.class::RANSACK_TYPES) %>
108
+ ```
109
+ - Some basic style to setup the filters as a sidebar (see the screenshot below):
77
110
  ```css
78
111
  .main-content__body {
79
112
  display: inline-block;
@@ -101,31 +134,35 @@ Screenshot:
101
134
  ![screenshot](screenshot.png)
102
135
 
103
136
  ## Extra notes
104
- - 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:
137
+
138
+ - 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:
105
139
  ```ruby
106
140
  def scoped_resource
107
141
  @ransack_results = super.ransack(params[:q])
108
142
  @ransack_results.result(distinct: true)
109
143
  end
110
144
  ```
111
- - 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:
145
+ - 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:
112
146
  ```ruby
113
147
  ransacker :keywords do
114
148
  Arel.sql("posts.metadata ->> 'keywords'")
115
149
  end
116
150
  ```
117
- - 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:
151
+ - 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:
118
152
  ```erb
119
153
  <%= link_to("Tag's posts", admin_posts_path('q[tags_id_in][]': page.resource.id), class: "button") %>
120
154
  ```
121
155
 
122
156
  ## Do you like it? Star it!
157
+
123
158
  If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
124
159
 
125
160
  Or consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).
126
161
 
127
162
  ## Contributors
163
+
128
164
  - [Mattia Roccoberton](https://blocknot.es/): author
129
165
 
130
166
  ## License
167
+
131
168
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -10,68 +10,54 @@
10
10
  </script>
11
11
  <% end %>
12
12
 
13
- <% attribute_labels ||= {} %>
14
- <% attribute_types ||= @dashboard.attribute_types.select { |key, _value| @dashboard.collection_attributes.include?(key) } %>
15
- <%= search_form_for [:admin, @ransack_results], html: { 'data-administrate-ransack-filters': '1' } do |f| %>
13
+ <%
14
+ attribute_labels ||= {}
15
+ attribute_types ||= @dashboard.attribute_types.select { |key, _value| @dashboard.collection_attributes.include?(key) }
16
+ form_options = { html: { 'data-administrate-ransack-filters': '1' } }
17
+ if local_assigns.has_key?(:search_path)
18
+ form_path = @ransack_results
19
+ form_options[:url] = search_path
20
+ clear_filters_path = search_path
21
+ else
22
+ form_path = [:admin, @ransack_results]
23
+ clear_filters_path = url_for(url_for([:admin, @ransack_results.klass]))
24
+ end
25
+ %>
26
+
27
+ <%= search_form_for form_path, form_options do |f| %>
16
28
  <div class="filters">
17
29
  <% attribute_types.each do |field, type| %>
18
30
  <% next if field == :id %>
19
31
 
20
- <div class="filter">
21
- <% input_type = type.is_a?(Administrate::Field::Deferred) ? type.deferred_class.to_s : type.to_s %>
32
+ <% label = attribute_labels.include?(field) ? attribute_labels[field] : field %>
33
+ <% model = @ransack_results.klass %>
34
+ <% input_type = type.is_a?(Administrate::Field::Deferred) ? type.deferred_class.to_s : type.to_s %>
35
+ <div class="filter <%= input_type.parameterize %>">
22
36
  <% case input_type %>
23
37
  <% when 'Administrate::Field::BelongsTo' %>
24
- <% association = @ransack_results.klass.reflections[field.to_s] %>
25
- <% if association %>
26
- <% label = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
27
- <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
28
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
29
- <%= f.collection_select "#{field}_id_eq", collection, :id, label, include_blank: true %>
30
- <% end %>
38
+ <% association = model.reflections[field.to_s] %>
39
+ <%= render 'administrate_ransack/components/field_belongs_to', form: f, model: model, field: field, label: label, association: association %>
31
40
  <% when 'Administrate::Field::Boolean' %>
32
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
33
- <%= f.select "#{field}_eq", [[t('administrate_ransack.filters.no'), false], [t('administrate_ransack.filters.yes'), true]], include_blank: true %>
41
+ <%= render 'administrate_ransack/components/field_boolean', form: f, model: model, field: field, label: label %>
34
42
  <% when 'Administrate::Field::Date' %>
35
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
36
- <%= f.date_field "#{field}_gteq" %>
37
- <%= f.date_field "#{field}_lteq" %>
43
+ <%= render 'administrate_ransack/components/field_date', form: f, model: model, field: field, label: label %>
38
44
  <% when 'Administrate::Field::DateTime' %>
39
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
40
- <%= f.datetime_field "#{field}_gteq" %>
41
- <%= f.datetime_field "#{field}_lteq" %>
45
+ <%= render 'administrate_ransack/components/field_datetime', form: f, model: model, field: field, label: label %>
42
46
  <% when 'Administrate::Field::Email', 'Administrate::Field::String', 'Administrate::Field::Text' %>
43
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
44
- <%= f.search_field "#{field}_cont" %>
47
+ <%= render 'administrate_ransack/components/field_string', form: f, model: model, field: field, label: label %>
45
48
  <% when 'Administrate::Field::Number' %>
46
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
47
- <%= f.number_field "#{field}_eq" %>
49
+ <%= render 'administrate_ransack/components/field_number', form: f, model: model, field: field, label: label %>
48
50
  <% when 'Administrate::Field::HasMany' %>
49
- <% association = @ransack_results.klass.reflections[field.to_s] %>
50
- <% if association %>
51
- <% label = association.klass.method_defined?(:admin_label) ? :admin_label : :to_s %>
52
- <% collection = association.klass.send(association.klass.respond_to?(:admin_scope) ? :admin_scope : :all) %>
53
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
54
- <%= f.collection_check_boxes "#{field}_id_in", collection, :id, label do |b| %>
55
- <%= b.label do %>
56
- <%= b.check_box %>
57
- <span><%= b.object.send(label) %></span>
58
- <% end %>
59
- <% end %>
60
- <% end %>
51
+ <% association = model.reflections[field.to_s] %>
52
+ <%= render 'administrate_ransack/components/field_has_many', form: f, model: model, field: field, label: label, association: association %>
61
53
  <% when 'Administrate::Field::Select' %>
62
- <%= f.label(attribute_labels.include?(field) ? attribute_labels[field] : field) %>
63
- <%= f.select "#{field}_eq", type.options[:collection], include_blank: true %>
54
+ <%= render 'administrate_ransack/components/field_select', form: f, model: model, field: field, label: label, type: type %>
64
55
  <% else %>
65
- <!-- unsupported Field::HasOne -->
66
- <!-- unsupported Field::Polymorphic -->
67
- <!-- unsupported Field::Password -->
56
+ <%= render 'administrate_ransack/components/field_other', form: f, model: model, field: field, label: label, type: type %>
68
57
  <% end %>
69
58
  </div>
70
59
  <% end %>
71
60
  </div>
72
61
 
73
- <div class="filters-buttons">
74
- <%= f.submit %>
75
- <%= link_to t('administrate_ransack.filters.clear_filters'), url_for([:admin, @ransack_results.klass]), class: 'btn-clear-filters' %>
76
- </div>
62
+ <%= render 'administrate_ransack/components/filter_buttons', form: f, clear_filters_path: clear_filters_path %>
77
63
  <% 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) %>
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) %>
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.10'
4
+ VERSION = '0.3.0'
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.10
4
+ version: 0.3.0
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-17 00:00:00.000000000 Z
11
+ date: 2021-05-19 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
@@ -227,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
83
  - !ruby/object:Gem::Version
228
84
  version: '0'
229
85
  requirements: []
230
- rubygems_version: 3.0.3
86
+ rubygems_version: 3.1.4
231
87
  signing_key:
232
88
  specification_version: 4
233
89
  summary: Administrate Ransack plugin