ct_table_for 0.1.15.beta → 1.0.0

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: 47d43adfaf238986ed6bc4a3179a2c1d88754ac7bdac76514b94425e189e3a4a
4
- data.tar.gz: edfb06df4f5c923a5982dda3121639006c749f23ea06b28bbc1a72d29786d0d8
3
+ metadata.gz: d910fc2f6ba2c9ea56176c54d4b60c41d2b1845d13a19020526a919f31560185
4
+ data.tar.gz: 4bad6c7c2b9e864e08c8e1bf56a7468b182084c59bb2409f7929c56ac423ae45
5
5
  SHA512:
6
- metadata.gz: eb1cbb2e933b3af1be135e9ec7ae13a93abcb442fe7820bfb28e73e3bbe800937d9282d64beb2a0dcd2dbb8caf0ba791a861a2e75602570dbb5ef78b41b7b4b2
7
- data.tar.gz: 2e8fedb77519ce6ace6e965863889ae052e97bf725e096a11c16d8e82fbaacdfeae432f44c4bb8f8e6340d1f1e37858193036ab5ccbd044a2165d8bd8fe834bb
6
+ metadata.gz: 5f6e7f7af479363af9e82c39a35b9e1432dbf9bfaba43626b36c78e7eb64e86a9ced2eb5e8d9cb1c7ab28e956c0ef92c9713f619dcd711d42e9c555a05109cd7
7
+ data.tar.gz: 8340c531da7fd72d62f8305f48960498921c028743abc45b65fb11db3707e4ee6ac0a43b94b9c81af60f9dd74f6664637a3f192518471d6b944bdc90b594d5d0
data/README.md CHANGED
@@ -44,7 +44,7 @@ And require the necessary javascript in `application.js` if you are using the `c
44
44
 
45
45
  ## Usage
46
46
 
47
- To get started, just use the `table_for_for` helper. Here's an example:
47
+ To get started, just use the `table_for` helper. Here's an example:
48
48
 
49
49
  ```erb
50
50
  <%= table_for Model, @collection %>
@@ -88,9 +88,9 @@ end
88
88
  ```
89
89
  You can also define the breakpoint in your `sass` before importing `table_for`:
90
90
 
91
- ```sass
91
+ ```scss
92
92
  $table-for-breakpoint: 768px;
93
- @import "table_for"
93
+ @import "table_for";
94
94
  ```
95
95
 
96
96
 
@@ -215,11 +215,22 @@ module CtTableFor
215
215
 
216
216
  def button_for_custom_action record, options, extras
217
217
  parsed_extras = parse_extras(extras)
218
- if options[:actions][:icons] != false
219
- label = %Q{<i class="#{CtTableFor.table_for_icon_font_base_class} #{CtTableFor.table_for_icon_font_base_class}-#{parsed_extras[:icon]}"></i>}
218
+ # `icons` is a Boolean-String option to limit `icon` option
219
+ label = if parsed_extras[:icons].to_s == "false"
220
+ parsed_extras[:title].presence || ""
221
+ else
222
+ %Q{<i class="#{CtTableFor.table_for_icon_font_base_class} #{CtTableFor.table_for_icon_font_base_class}-#{parsed_extras[:icon]}"></i>}
223
+ end
224
+ ancestors_list = parsed_extras[:ancestors].presence || ""
225
+ ancestors = ancestors_list.split(",").map do |ancestor|
226
+ record.send(ancestor)
220
227
  end
221
228
  custom_action_class = %Q{#{CtTableFor.table_for_default_action_base_class} #{parsed_extras[:class]}}
222
- link_to(label.html_safe, polymorphic_path([parsed_extras[:link], record]), class: custom_action_class, title: parsed_extras[:title])
229
+ link_to(label.html_safe,
230
+ polymorphic_path([parsed_extras[:link], *ancestors, record]),
231
+ class: custom_action_class,
232
+ method: parsed_extras[:method],
233
+ title: parsed_extras[:title])
223
234
  end
224
235
 
225
236
  def uri?(string)
@@ -1,3 +1,3 @@
1
1
  module CtTableFor
2
- VERSION = '0.1.15.beta'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ct_table_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15.beta
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustí B.R.
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-07 00:00:00.000000000 Z
13
+ date: 2019-04-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -63,9 +63,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3.1
68
+ version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
71
  rubygems_version: 2.7.6