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
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 13 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
23 24 25 26 27 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 23 def edit if @sandbox.valid? @sandbox.result = Liquidum.render(@sandbox.template, assigns: JSON.parse(@sandbox.context)) end end |
#index ⇒ Object
7 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 7 def index; end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 9 def new render :edit end |
#update ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/liquidum/sandbox_controller.rb', line 29 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 |