Class: AestheticsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AestheticsController
- Defined in:
- app/controllers/aesthetics_controller.rb
Overview
Handles aesthetic modifications
Instance Method Summary collapse
-
#create ⇒ nil
deprecated
Deprecated.
no use
-
#destroy ⇒ nil
deprecated
Deprecated.
no use
-
#edit ⇒ Aesthetic
This method sets the aesthetic object to be edited.
-
#index ⇒ nil
deprecated
Deprecated.
no use
-
#reload_demo ⇒ Aesthetic
This method uploads the dummy Aesthetic model for the partial view.
-
#update ⇒ Aesthetic
This method updates the aesthetic object.
Instance Method Details
#create ⇒ nil
Deprecated.
no use
10 11 |
# File 'app/controllers/aesthetics_controller.rb', line 10 def create end |
#destroy ⇒ nil
Deprecated.
no use
54 55 |
# File 'app/controllers/aesthetics_controller.rb', line 54 def destroy end |
#edit ⇒ Aesthetic
This method sets the aesthetic object to be edited
17 18 19 |
# File 'app/controllers/aesthetics_controller.rb', line 17 def edit @aesthetic = Aesthetic.find_by(id: params[:id]) end |
#index ⇒ nil
Deprecated.
no use
5 6 |
# File 'app/controllers/aesthetics_controller.rb', line 5 def index end |
#reload_demo ⇒ Aesthetic
This method uploads the dummy Aesthetic model for the partial view
40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/aesthetics_controller.rb', line 40 def reload_demo @aesthetic = Aesthetic.find(params[:id]) if @aesthetic.update(aesthetic_params) respond_to do |format| format.html { render partial: "shared/#{params[:game_id]}" } end else render json: { error: @aesthetic.errors. }, status: :unprocessable_entity end end |
#update ⇒ Aesthetic
This method updates the aesthetic object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/aesthetics_controller.rb', line 26 def update @aesthetic = Aesthetic.find_by(id: params[:id]) if @aesthetic.update(aesthetic_params) redirect_to edit_aesthetic_path(@aesthetic), notice: "Aesthetic was successfully updated." else redirect_to edit_aesthetic_path(@aesthetic), alert: "Aesthetic was not updated." end end |