will_sortate 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: f48de9d7ed4b92ac456067cc0b01ef5cdda21f9a
4
- data.tar.gz: cc86dd749e8a0cce28b0385c686710a24ee95965
3
+ metadata.gz: 2975faabedcffeb39f22571f893133f4267d5aba
4
+ data.tar.gz: 7d8a9b6c01f8ad8e2bde9eaf3a96c70d9bb229a1
5
5
  SHA512:
6
- metadata.gz: e0082bf82a6e413a20c4f8b958ccc642459f4713c39083f80374b31108987831aa811ff44031c314559b7f3d2ff09da00e8104a7f68f862f4dd732a45dd4659e
7
- data.tar.gz: 81cbcab6d67c98e38dddc9fe4a186fd2949b16e5b2b44746448c8356dbcc6dcbf17ee2f74a8322bc3196216d9a4a1b7a28dda6423a040fb56b6c8ee38ae3e9bc
6
+ metadata.gz: bfd24feedcd392c67b74da8ca17299aebae8dace011102aa63c54a2b2199eb781ae0dc9808671c42f9b219a9e88d8274a35211a96cd498b6c40f6c002e50860e
7
+ data.tar.gz: d1d2e720fdc7320fb5e31c6b494ad3e75c34b03b12764547482b0cff5aa1d5b50dc5381eaa51d837fd2b3979739bdb70379843d0e6a88ec7a0205b2e665b1b50
data/README.md CHANGED
@@ -31,7 +31,10 @@ The sort argument indicates the column and order direction, so `my_field_asc` wi
31
31
  ### In your views
32
32
 
33
33
  ```erb
34
- <%= sortate_link_to @shorties, :my_field, options %>
34
+ <%= sortate_link_to 'One Field', @shorties, :one_field, options %>
35
+ <%= sortate_link_to @shorties, :my_field, options do %>
36
+ My Field
37
+ <% end %>
35
38
  ```
36
39
 
37
40
  The options argument is optional and will be passed to the underlying link_to. In addition you can pass in the options hash:
@@ -41,7 +44,7 @@ The options argument is optional and will be passed to the underlying link_to. I
41
44
  E.g.:
42
45
 
43
46
  ```erb
44
- <%= sortate_link_to @shorties, :my_field, class: 'sort_link', default_sort_order: 'desc' %>
47
+ <%= sortate_link_to 'My Field', @shorties, :my_field, class: 'sort_link', default_sort_order: 'desc' %>
45
48
  ```
46
49
 
47
50
  ## TODO
@@ -3,7 +3,7 @@ module WillSortate
3
3
  attr_reader :sortated_field, :sortated_order
4
4
 
5
5
  def sortate order_by, default_order_by
6
- regexp = /(\w+)_(asc|desc)$/
6
+ regexp = /([\w\.-]+)_(asc|desc)$/
7
7
  md = order_by.try(:match, regexp) || default_order_by.match(regexp)
8
8
  raise "OrderBy argument has to be specified in the format :field_:direction" unless md
9
9
 
@@ -1,3 +1,3 @@
1
1
  module WillSortate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_sortate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Racco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-28 00:00:00.000000000 Z
11
+ date: 2013-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler