Skip to content

drn05r/rails3_acts_as_licensable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails3ActsAsLicensable

Installation

Clone the Rails3ActsAsLicensable Engine from GitHub.

git clone git://github.com/drn05r/rails3_acts_as_licensable.git

In the application using the engine add the following line to the Gemfile (assuming the engine is cloned to the same parent directory as the application):

gem 'rails3_acts_as_licensable', :path => "../rails3_acts_as_licensable"

Again, in application using the engine add the following line before the final ‘end’ in config/routes.rb.

mount Rails3ActsAsLicensable::Engine => "/"

Run the following line from the root directory of the application using the engine, answering yes to any prompted questions.

rails generate rails3_acts_as_licensable

Making Classes Licensable

Add the following line inside the class declaration of the model files you want to be licensable.

acts_as_licensable

Then migrate the database.

rake db:migrate

Configuring Licenses

By default this module provides the 6 Creative Commons licenses as describe at creativecommons.org/licenses/ as well as the CC0 Public Domain license describe at creativecommons.org/choose/zero/.

If you wish to add additional licenses you will need to edit the rails3_acts_as_licensable.yml file in your application’s config directory before migrating the database. You will also need to edit the appropriate locales files in the application using the engine’s config/locales directory. Currently English and German locales are provided.

By default the license_icon_url helper function in app/helpers/rails3_acts_as_licensable/application_helper.rb provides license icions of the size 88x31 pixels. If you wish to use icoms of a different size you must specify this in the second parameter. Other valid sizes include 80x15 and 88x15, see i.creativecommons.org/l/ to see what icon sizes are provided for the licenses you intend to use. For consistency the license_icon_size parameter can be set in the application using the engine’s config/rails3_acts_as_licensable.yml and this will be used by the /licenses and /licenses/:id pages.

About

Rails3 Engine for applying licenses to user contributions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published