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: 'mail@example.com', password: 'ultrasekret')
# Find a specific user and modify:
u = User.find_by_email('mail@example.com')
u.email = 'new@example.com'
u.password = 'newsecret'
u.save