Class: LesliDashboard::AssistantsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lesli_dashboard/assistants_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /assistants



24
25
26
27
28
29
30
31
32
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 24

def create
  @assistant = Assistant.new(assistant_params)

  if @assistant.save
    redirect_to @assistant, notice: "Assistant was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /assistants/1



44
45
46
47
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 44

def destroy
  @assistant.destroy
  redirect_to assistants_url, notice: "Assistant was successfully destroyed.", status: :see_other
end

#editObject

GET /assistants/1/edit



20
21
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 20

def edit
end

#indexObject

GET /assistants



6
7
8
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 6

def index
  @assistants = Assistant.all
end

#newObject

GET /assistants/new



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

def new
  @assistant = Assistant.new
end

#showObject

GET /assistants/1



11
12
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /assistants/1



35
36
37
38
39
40
41
# File 'app/controllers/lesli_dashboard/assistants_controller.rb', line 35

def update
  if @assistant.update(assistant_params)
    redirect_to @assistant, notice: "Assistant was successfully updated.", status: :see_other
  else
    render :edit, status: :unprocessable_entity
  end
end