Class: Liquidum::SandboxController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Liquidum::SandboxController
- Defined in:
- app/controllers/liquidum/sandbox_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 14 def create return render_only if params[:render_only] == "commit" @sandbox.update(sandbox_attributes) respond_with @sandbox, collection_location: -> { edit_sandbox_path(@sandbox) }, action: :edit end |
#edit ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 24 def edit if @sandbox.valid? @sandbox.result = Liquidum.render(@sandbox.template, assigns: JSON.parse(@sandbox.context)) end end |
#index ⇒ Object
7 8 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 7 def index end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 10 def new render :edit end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 30 def update return render_only if params[:render_only] == "commit" @sandbox.update(sandbox_attributes) respond_with @sandbox, collection_location: -> { edit_sandbox_path(@sandbox) }, action: :edit end |