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 = row[:item].classify.constantize
102
- model_symbol = row[:item].demodulize.underscore.pluralize.to_sym
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
- url = row[:url ] || [BootstrapAdmin.admin_namespace, model_symbol]
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
 
@@ -1,3 +1,3 @@
1
1
  module BootstrapAdmin
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: