Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fadendaten/succession
Rails Engine to provide a user managed succession
https://github.com/fadendaten/succession
Last synced: about 1 month ago
JSON representation
Rails Engine to provide a user managed succession
- Host: GitHub
- URL: https://github.com/fadendaten/succession
- Owner: fadendaten
- License: mit
- Created: 2013-08-09T10:48:06.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-21T16:07:59.000Z (almost 11 years ago)
- Last Synced: 2024-03-25T22:01:11.337Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 441 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Succession
[![Gem Version](https://badge.fury.io/rb/succession.png)](http://badge.fury.io/rb/succession)
[![Dependency Status](https://gemnasium.com/fadendaten/succession.png)](https://gemnasium.com/fadendaten/succession)Manage the Rails object succession easily.
If you want to provide a user manage succession for a Rails object, you can simply
add this gem.## Installation
Add to your Gemfile:
gem succession
and run the bundle install command.
After the installation type into your terminal:rake succession:install:migrations
to move the gem's migrations into your application.
## Usage
### Model
To add the succession behavior, put this code into your model.
class Post < ActiveRecord::Base
include Succession# Your code.
end
### View
There are two ways to implement the up and down rating into your view.
#### 1. up_link_to, down_link_to
If you want to use links add this into your view files:
For up rating:
<%= up_link_to "rate up", @post%>
For down rating:
<%= down_link_to "rate up", @post%>
#### 2. up_button_to, down_button_to
If you are more the button type, use this:
For up rating:
<%= up_button_to "rate up", @post%>
For down rating:
<%= down_button_to "rate up", @post%>
## Copyright
Copyright (c) 2013 Fadendaten GmbH. See MIT-LICENSE for details.