bootstrap_actioncell 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,13 @@
|
|
1
1
|
module BootstrapActioncell
|
2
2
|
module ActioncellHelper
|
3
|
-
def ac_buttons(resource,buttons=[],actions=[])
|
3
|
+
def ac_buttons(resource,buttons=[],actions=[],options={})
|
4
|
+
options = {
|
5
|
+
:clear_default_buttons => false
|
6
|
+
}.deep_merge(options)
|
7
|
+
unless options[:clear_default_buttons]
|
8
|
+
buttons << {:path => url_for(:controller => resource.class.name.demodulize.underscore.pluralize, :action => 'edit', :id => resource.id), :options => {:class => "btn btn-mini", "data-toggle" => "tooltip", :title => "Edit"}, :icon => "pencil"} if current_ability.blank? or can? :update, resource
|
9
|
+
buttons << {:path => url_for(:controller => resource.class.name.demodulize.underscore.pluralize, :action => 'destroy', :id => resource.id), :options => {:class => "btn btn-mini", "data-toggle" => "tooltip", :title => "Delete", :method => "delete", :confirm => "Are you sure you want to delete this #{resource.class.name.demodulize.underscore.split("_").join(" ")}?"}, :icon => "remove-2"} if current_ability.blank? or can? :destroy, resource
|
10
|
+
end
|
4
11
|
render :partial => "bootstrap_actioncell/buttons", :locals => {:resource => resource, :buttons => buttons, :actions => actions}
|
5
12
|
end
|
6
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_actioncell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: -4332477587900814721
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
segments:
|
154
154
|
- 0
|
155
|
-
hash:
|
155
|
+
hash: -4332477587900814721
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
158
|
rubygems_version: 1.8.25
|