Class: LesliSupport::Dashboard::ComponentsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/lesli_support/dashboard/components_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /dashboard/components



56
57
58
59
60
61
62
63
64
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 56

def create
  @dashboard_component = Dashboard::Component.new(dashboard_component_params)

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

#destroyObject

DELETE /dashboard/components/1



76
77
78
79
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 76

def destroy
  @dashboard_component.destroy
  redirect_to dashboard_components_url, notice: "Component was successfully destroyed.", status: :see_other
end

#editObject

GET /dashboard/components/1/edit



52
53
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 52

def edit
end

#indexObject

GET /dashboard/components



38
39
40
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 38

def index
  @dashboard_components = Dashboard::Component.all
end

#newObject

GET /dashboard/components/new



47
48
49
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 47

def new
  @dashboard_component = Dashboard::Component.new
end

#showObject

GET /dashboard/components/1



43
44
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 43

def show
end

#updateObject

PATCH/PUT /dashboard/components/1



67
68
69
70
71
72
73
# File 'app/controllers/lesli_support/dashboard/components_controller.rb', line 67

def update
  if @dashboard_component.update(dashboard_component_params)
    redirect_to @dashboard_component, notice: "Component was successfully updated.", status: :see_other
  else
    render :edit, status: :unprocessable_entity
  end
end