Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 1.92 KB

README.markdown

File metadata and controls

71 lines (44 loc) · 1.92 KB

Devise links

View link helpers for Devise actions

Install

gem install devise-links

Alternatively insert into Rails 3 Gemfile:

  gem 'devise-links'

Run $ bundle install in terminal from root of Rails app

Updates

See 'Changelog.txt'

Nov 26, 2010

Major update to make the gem independent of Cream

  • Removed dependency on #auth_labels method in Cream, now uses internal #labels method
  • Added devise:links generator that can generate a 'cream' locale file for the labels used

Usage

The gem adds a set of convenient view helpers that are available inside any Rails view:

  <%= new_registration_link(:role => :admin) %>  
  <%= sign_out_link(:role => :admin, :label => 'Log me out!') %>

Generators

Running the devise:links generator should generate a locale file called 'cream.en.yml' in your Rails app /locales dir.

rails g devise:links

To enable i18n (translations), please set Devise::Links.translate = true fx in a Rails initializer file.

Contributions and more info

See specs for demonstrations of how to use the API etc. To contribute, please enhance by writing specs and then adjusting/enhancing the functionality

TODO

Make API more generic...

  <%= new_registration_link(:admin) %>  
  <%= sign_out_link(:admin, 'Log out') %>  
  <%= new_registration_link('Register!') %>  

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2010 Kristian Mandrup. See LICENSE for details.