Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

Has_secured_password

Rails Cast on Authentication Rails 3.1 also want to check out Rails cast on Authentication from Scratch

The user model rails allows you to call

has_secure_password
1
2
3
4
5
class User < ActiveRecord::Base
  attr_accessible :email, :password, :password_confirmation
  has_secure_password
  validates_presence_of :password, :on => :create
end

You will likely want to add validation for the email address as well, but that’s outside the scope of this…

The has_secure_password setting automatically adds validation for mismatched password between the password and password confirmation fields.

Helper Methods: specifically :current_user

See the post on this.

SSL

can also add options for ssl with the simple line in the ApplicationController:

1
2
protect_from_forgery
force_ssl

This will only be reflected in production and test environments NOT development…

Comments