i18n_rails_helpers 0.12.0 → 0.13.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.
- data/lib/list_link_helpers.rb +7 -4
- metadata +2 -2
data/lib/list_link_helpers.rb
CHANGED
@@ -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
|
-
|
37
|
+
path = polymorphic_path(resource_or_model)
|
38
38
|
when 'delete'
|
39
|
-
|
39
|
+
path = polymorphic_path(resource_or_model)
|
40
|
+
options.merge!(:confirm => t_confirm_delete(resource), :method => :delete)
|
40
41
|
else
|
41
|
-
|
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)
|