Class: LesliBell::DashboardsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lesli_bell/dashboards_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /dashboards



23
24
25
26
27
28
29
30
31
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 23

def create
  @dashboard = Dashboard.new(dashboard_params)

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

#destroyObject

DELETE /dashboards/1



43
44
45
46
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 43

def destroy
  @dashboard.destroy
  redirect_to dashboards_url, notice: "Dashboard was successfully destroyed.", status: :see_other
end

#editObject

GET /dashboards/1/edit



19
20
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 19

def edit
end

#indexObject

GET /dashboards



6
7
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 6

def index
end

#newObject

GET /dashboards/new



14
15
16
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 14

def new
  @dashboard = Dashboard.new
end

#showObject

GET /dashboards/1



10
11
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 10

def show
end

#updateObject

PATCH/PUT /dashboards/1



34
35
36
37
38
39
40
# File 'app/controllers/lesli_bell/dashboards_controller.rb', line 34

def update
  if @dashboard.update(dashboard_params)
    redirect_to @dashboard, notice: "Dashboard was successfully updated.", status: :see_other
  else
    render :edit, status: :unprocessable_entity
  end
end