Sha256: 103b9d60f66678824a98399ed504794fa92073939c5254cfc4a7525bb60837de

Contents?: true

Size: 979 Bytes

Versions: 9

Compression:

Stored size: 979 Bytes

Contents

class TestContainersController < ApplicationController
  before_action :set_test_container, only: [:show, :edit, :update, :destroy]
  def index
    @test_containers = TestContainer.all
  end

  def show
  end

  def new
    @test_container = TestContainer.new
  end

  def edit
  end

  def create
    @test_container = test_container.new(test_container_params)
    if @test_container.save
      @test_container.save_content(components)
      redirect_to @test_container, notice: 'test_container was successfully created.'
    else
      render :new
    end
  end

  def update
    if @test_container.save_content(components)
      redirect_to @test_container, notice: 'test_container was successfully updated.'
    else
      render :edit
    end
  end

  def set_test_container
    @test_container = TestContainer.find(params[:id])
  end

  # Only allow a trusted parameter "white list" through.
  def test_container_params
    params.require(:test_container).permit
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
cm_page_builder-0.2.3 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-0.2.2 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.2.2 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.2.1 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.2.0 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.1.12 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.1.11 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.1.10 spec/dummy/app/controllers/test_containers_controller.rb
cm_page_builder-rails-0.1.9 spec/dummy/app/controllers/test_containers_controller.rb