Skip to content

Quick and painless action links for your rails applications

Notifications You must be signed in to change notification settings

jesilz/action_links

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]
    

About

Quick and painless action links for your rails applications

Resources

Stars

Watchers

Forks

Packages

No packages published