Class: LesliAdmin::Dashboard::ComponentsController
- Inherits:
-
ApplicationController
- Object
- Lesli::ApplicationLesliController
- ApplicationController
- LesliAdmin::Dashboard::ComponentsController
- Defined in:
- app/controllers/lesli_admin/dashboard/components_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /dashboard/components.
-
#destroy ⇒ Object
DELETE /dashboard/components/1.
-
#edit ⇒ Object
GET /dashboard/components/1/edit.
-
#index ⇒ Object
GET /dashboard/components.
-
#new ⇒ Object
GET /dashboard/components/new.
-
#show ⇒ Object
GET /dashboard/components/1.
-
#update ⇒ Object
PATCH/PUT /dashboard/components/1.
Instance Method Details
#create ⇒ Object
POST /dashboard/components
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 24 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 |
#destroy ⇒ Object
DELETE /dashboard/components/1
44 45 46 47 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 44 def destroy @dashboard_component.destroy redirect_to dashboard_components_url, notice: "Component was successfully destroyed.", status: :see_other end |
#edit ⇒ Object
GET /dashboard/components/1/edit
20 21 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 20 def edit end |
#index ⇒ Object
GET /dashboard/components
6 7 8 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 6 def index @dashboard_components = Dashboard::Component.all end |
#new ⇒ Object
GET /dashboard/components/new
15 16 17 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 15 def new @dashboard_component = Dashboard::Component.new end |
#show ⇒ Object
GET /dashboard/components/1
11 12 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 11 def show end |
#update ⇒ Object
PATCH/PUT /dashboard/components/1
35 36 37 38 39 40 41 |
# File 'app/controllers/lesli_admin/dashboard/components_controller.rb', line 35 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 |