Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/user.rb

Overview

Users are the administrators of a blog. Since there is no interface to manage users, they have to be modified via Rails console.

Examples:

rails c
# Create a new user:
User.create(email: '[email protected]', password: 'ultrasekret')
# Find a specific user and modify:
u = User.find_by_email('[email protected]')
u.email = '[email protected]'
u.password = 'newsecret'
u.save