Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Quick and painless action links for your rails applications
branch: master

This branch is 9 commits behind biola:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
Gemfile
README.rdoc
Rakefile
action_links.gemspec

README.rdoc

Action_Links

Action_Links automatically includes action links (show, edit, destroy) based on the current page and user roles/permissions.

Installation

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

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

Usage

  • 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]
Something went wrong with that request. Please try again.