Class: UsersController

Inherits:
LazyController show all
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods inherited from LazyController

app_class_eval, app_instance_eval, inherited

Methods inherited from Studio54::Base

require_all_models, require_models

Instance Method Details

#allObject



11
12
13
# File 'app/controllers/users_controller.rb', line 11

def all
  @users = User.all
end

#create(params) ⇒ Object



23
24
25
26
# File 'app/controllers/users_controller.rb', line 23

def create(params)
  @user = User.new params[:user]
  @user.save
end

#find_byObject



15
16
17
# File 'app/controllers/users_controller.rb', line 15

def find_by
  @user = User.find_by({:name => "andrew", :id => 5}, :conjunction => 'OR')
end

#indexObject



7
8
9
# File 'app/controllers/users_controller.rb', line 7

def index
  @user = User.find(1)
end

#newObject



19
20
21
# File 'app/controllers/users_controller.rb', line 19

def new
  @user = User.new
end