i18n_rails_helpers 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/list_link_helpers.rb +7 -4
  2. metadata +2 -2
@@ -6,7 +6,7 @@ module ListLinkHelpers
6
6
  link_to(t_action(action), url, options)
7
7
  end
8
8
 
9
- def list_link_for(action, resource_or_model = nil)
9
+ def list_link_for(action, resource_or_model = nil, options = {})
10
10
  # Handle both symbols and strings
11
11
  action = action.to_s
12
12
 
@@ -34,12 +34,15 @@ module ListLinkHelpers
34
34
  # Link generation
35
35
  case action
36
36
  when 'index', 'show'
37
- return list_link_to(action, polymorphic_path(resource_or_model))
37
+ path = polymorphic_path(resource_or_model)
38
38
  when 'delete'
39
- return list_link_to(action, polymorphic_path(resource_or_model), :confirm => t_confirm_delete(resource), :method => :delete)
39
+ path = polymorphic_path(resource_or_model)
40
+ options.merge!(:confirm => t_confirm_delete(resource), :method => :delete)
40
41
  else
41
- return list_link_to(action, polymorphic_path(resource_or_model, :action => action))
42
+ path = polymorphic_path(resource_or_model, :action => action)
42
43
  end
44
+
45
+ return list_link_to(action, path, options)
43
46
  end
44
47
 
45
48
  def list_links_for(action = nil, resource_or_model = nil)
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 12
7
+ - 13
8
8
  - 0
9
- version: 0.12.0
9
+ version: 0.13.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Simon H\xC3\xBCrlimann"