Action_Links automatically includes action links (show, edit, destroy) based on the current page and user roles/permissions.
Action_Links has been tested through Rails 3.0.10.
Add the following to your Gemfile
gem "action_links"
From the command line
> bundle install
Configuration is optional. Everything will work out of the box.
ActionLinks.configure do |config| config.bootstrap_action_classes = { :show => 'btn', :edit => 'btn', :destroy => 'btn btn-danger' } config.bootstrap_action_icons = { :show => 'icon-eye-open', :edit => 'icon-pencil', :destroy => 'icon-remove icon-white' } end
-
Basic Usage
action_links @user
-
Include actions
action_links @user, :include => [:download]
-
Exclude actions
action_links @user, :exclude => [:edit, :destroy]
-
Pass in block
action_links @user do link_to "Hello World", dashboard_path end
-
Bootstrap buttons. See configuration to customize button types and icons.
bootstrap_action_links @user
-
Namespaced objects
action_links [:manage, @product]