Sha256: 592ab130d3b3177eb987fb740e664b31457820d40eaa7a47964b6ff04e8a952b

Contents?: true

Size: 1.8 KB

Versions: 19

Compression:

Stored size: 1.8 KB

Contents

Description:
    Generates a user model, users controller, and sessions controller. The
    users controller handles the registration and the sessions controller
    handles authentication. This is similar to restful_authentication, but
    simpler.

    IMPORTANT: This generator uses the "title" helper method which is generated
    by the nifty_layout generator. You may want to run that generator first.

Usage:
    If you do not pass any arguments, the model name will default to "user", and
    the authentication controller will default to "session". You can override
    each of these respectively by passing one or two arguments. Either name can
    be CamelCased or under_scored.

    Make sure to setup the authlogic gem if you are using that option.

      gem "authlogic" # in Gemfile

Examples:
    rails generate nifty:authentication

        Creates user model, users_controller, and sessions_controller.

    rails generate nifty:authentication account

        Creates account model, accounts_controller, and sessions_controller.

    rails generate nifty:authentication Account UserSession

        Creates account model, accounts_controller, and user_sessions_controller.

Methods:
    There are several methods generated which you can use in your application.
    Here's a common example of what you might add to your layout.

      <% if logged_in? %>
        Welcome <%= current_user.username %>! Not you?
        <%= link_to "Log out", logout_path %>
      <% else %>
        <%= link_to "Sign up", signup_path %> or
        <%= link_to "log in", login_path %>.
      <% end %>

    You can also restrict unregistered users from accessing a controller using
    a before filter. For example.

      before_filter :login_required, :except => [:index, :show]

    See the generated file lib/authentication.rb for details.

Version data entries

19 entries across 19 versions & 5 rubygems

Version Path
nifty-generators-improved-0.5 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.12 lib/generators/nifty/authentication/USAGE
nifty-generators-0.4.6 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.11 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.10 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.9 lib/generators/nifty/authentication/USAGE
nifty-generators-0.4.5 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.8 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.7 lib/generators/nifty/authentication/USAGE
flockonus-nifty-generators-0.0.6 lib/generators/nifty/authentication/USAGE
redis-messages-0.1 lib/generators/redis_messages/USAGE
nifty-generators-0.4.4 lib/generators/nifty/authentication/USAGE
nifty-generators-0.4.3 lib/generators/nifty/authentication/USAGE
seivan-generators-0.5 lib/generators/seivan/authentication/USAGE
seivan-generators-0.4 lib/generators/seivan/authentication/USAGE
seivan-generators-0.3 lib/generators/seivan/authentication/USAGE
seivan-generators-0.2 lib/generators/seivan/authentication/USAGE
nifty-generators-0.4.2 lib/generators/nifty/authentication/USAGE
nifty-generators-0.4.1 lib/generators/nifty/authentication/USAGE