There's one update to these links. These links tell you to add your attribute (in your case, :username) to attr_accessible in the model user.rb. Devise has be re-written since these links were written to use strong parameters. Instead of adding the attr_accessible line to your model, you need to create a custom controller which is a bit of work. Following the example of these links, to add the attribute :username to the model users, you would add the following users_controller.rb:
class UsersController < Devise::RegistrationsController
private
def sign_up_params
params.require(:user).permit(:username, :email, :password, :password_confirmation)
end
def account_update_params
params.require(:user).permit(:username, :email, :password, :password_confirmation, :current_password)
end
end
Note that the controller inherits from Devise::RegistrationsController, not ApplicationController.
You will then need to change your routes in config/routes.rb by adding the following lines:
devise_for :users, :controllers => { :registrations => "users" }
devise_scope :user do
resources :users
end
This is, obviously, considerable more work but will be necessary going forward with strong parameters.
The other steps in the links provided still apply.