Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rails powered blog for developers (syntax highlight, compass, fancy-buttons and haml)
tree: 382c44cfff

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
autotest
config
db
doc
features
lib
public
script
spec
.gitignore
.rspec
Gemfile
README
Rakefile
config.ru

README

Devise will create some helpers to use inside your controllers and views. To set up a controller with user authentication, just add this before_filter:
  before_filter :authenticate_user!
To verify if a user is signed in, use the following helper:
  user_signed_in?
For the current signed-in user, this helper is available:
  current_user
You can access the session for this scope:
  user_session
  
  
In the routes you can modify the resource.
  devise_for :users, :path => "usuarios", 
  :path_names => { 
    :sign_in => 'login', 
    :sign_out => 'logout', 
    :password => 'secret', 
    :confirmation => 'verification', 
    :unlock => 'unblock', 
    :registration => 'register', 
    :sign_up => 'cmon_let_me_in' 
    }
    
Finally, you need to set up default url options for the mailer in each environment. Here is the configuration for config/environments/development.rb:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }


Alternative way of doing admin
# Create a migration with the required fields
  create_table :admins do |t|
    t.database_authenticatable
    t.lockable
    t.trackable
    t.timestamps
  end

  # Inside your Admin model
  devise :database_authenticatable, :trackable, :timeoutable, :lockable

  # Inside your routes
  devise_for :admins

  # Inside your protected controller
  before_filter :authenticate_admin!

  # Inside your controllers and views
  admin_signed_in?
  current_admin
  admin_session


Devise :database_authenticatable, :confirmable, :recoverable, :encryptor => :bcrypt
  Besides :encryptor, you can define :pepper, :stretches, :confirm_within, :remember_for, :timeout_in, :unlock_in and other values. For details, see the initializer file that was created when you invoked the "devise:install" generator described above.
Something went wrong with that request. Please try again.