bootstrap_admin 0.0.10 → 0.0.11
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.
@@ -97,16 +97,23 @@ module BootstrapAdmin::MenuHelper
|
|
97
97
|
css_class = row[:class] || "dropdown-toggle"
|
98
98
|
data_attr = { :toggle => "dropdown" }
|
99
99
|
|
100
|
+
|
100
101
|
else #then its a resource link.
|
101
|
-
model_class
|
102
|
-
|
102
|
+
model_class = if row[:namespace]
|
103
|
+
"#{row[:namespace]}::#{row[:item]}".classify.constantize
|
104
|
+
else
|
105
|
+
row[:item].classify.constantize
|
106
|
+
end
|
107
|
+
|
108
|
+
model_symbol = row[:item].underscore.pluralize.to_sym
|
103
109
|
|
104
110
|
label = if row[:label].is_a? Symbol
|
105
111
|
t row[:label]
|
106
112
|
else
|
107
113
|
row[:label] || model_class.model_name.human.pluralize
|
108
114
|
end
|
109
|
-
|
115
|
+
|
116
|
+
url = row[:url] || bootstrap_url_for(:controller => "#{row[:namespace] || BootstrapAdmin.admin_namespace}::#{row[:item]}".underscore.pluralize)
|
110
117
|
css_class = row[:class]
|
111
118
|
data_attr = {}
|
112
119
|
end
|
@@ -34,8 +34,10 @@ module BootstrapAdmin
|
|
34
34
|
else
|
35
35
|
if delete?
|
36
36
|
controller.flash[:success] = I18n.t("helpers.messages.destroy.success", :model => resource.class.model_name.human)
|
37
|
+
redirect_to :controller => controller.controller_name
|
38
|
+
else
|
39
|
+
super
|
37
40
|
end
|
38
|
-
super
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|