action_links 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,6 @@ Action_Links automatically includes action links (show, edit, destroy) based on
5
5
 
6
6
  == Installation
7
7
 
8
- Action_Links has been tested through Rails 3.0.10.
9
-
10
8
  Add the following to your Gemfile
11
9
 
12
10
  gem "action_links"
@@ -15,16 +13,20 @@ From the command line
15
13
 
16
14
  > bundle install
17
15
 
16
+ Action Links is built to work with {Declarative Authorization}[https://github.com/stffn/declarative_authorization]
17
+
18
18
 
19
19
  == Configuration
20
20
 
21
21
  Configuration is optional. Everything will work out of the box.
22
22
 
23
23
  ActionLinks.configure do |config|
24
- config.bootstrap_action_classes = { :show => 'btn', :edit => 'btn', :destroy => 'btn btn-danger' }
25
- config.bootstrap_action_icons = { :show => 'icon-eye-open', :edit => 'icon-pencil', :destroy => 'icon-remove icon-white' }
24
+ @bootstrap_action_classes = { :show => 'btn', :edit => 'btn', :destroy => 'btn btn-danger' }
25
+ @bootstrap_action_icons = { :show => 'icon-eye-open', :edit => 'icon-pencil', :destroy => 'icon-remove icon-white' }
26
+ @action_icons = { :show => 'eye-open', :edit => 'pencil', :destroy => 'remove' }
26
27
  end
27
28
 
29
+
28
30
  == Usage
29
31
 
30
32
  * Basic Usage
@@ -57,4 +59,11 @@ Configuration is optional. Everything will work out of the box.
57
59
 
58
60
  =action_link :edit, @event
59
61
  // or more advanced
60
- =action_link :clone, @event, link_wrapper: :li, url: url_for([:clone, @event]), icon: 'copy', text: 'Copy'
62
+ =action_link :clone, @event, link_wrapper: :li, url: url_for([:clone, @event]), icon: 'copy', text: 'Copy', class: 'btn'
63
+
64
+ * You can even pass in custom attributes with the :html tag
65
+
66
+ =action_link :clone, @event, class: 'btn', html: { id: 'super_cool_clone_button' }
67
+ // NOTE: if you define 'class' in the :html hash, it will overwrite the default class,
68
+ // otherwise you can define class outside of the :html hash like in the above example
69
+ // and it will be added to the default value.
@@ -62,6 +62,8 @@ module ActionLinks
62
62
  @html_options.merge! :method=>:delete, :data=>{ :confirm=>I18n.t(:confirm_delete, :scope=>'action_links', :default=>'Are you sure?') }
63
63
  end
64
64
 
65
+ @html_options.merge! options[:html] if options[:html]
66
+
65
67
  @html_options
66
68
  end
67
69
 
@@ -1,3 +1,3 @@
1
1
  module ActionLinks
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_links
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-16 00:00:00.000000000 Z
13
+ date: 2012-12-06 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Automatically includes action links (show, edit, destroy) based on the
16
16
  current page and user roles/permissions