Sha256: 36b4947801d63a812b67c1de87809f04ab53a1009fad9689dfa377b57223d2be

Contents?: true

Size: 1.82 KB

Versions: 12

Compression:

Stored size: 1.82 KB

Contents

class PostsWithCollectionAndFilesController < ApplicationController
  before_action :set_posts_with_collection_and_file, only: [:show, :edit, :update, :destroy]

  # GET /posts_with_collection_and_files
  def index
    @posts_with_collection_and_files = PostsWithCollectionAndFile.all
  end

  # GET /posts_with_collection_and_files/1
  def show
  end

  # GET /posts_with_collection_and_files/new
  def new
    @posts_with_collection_and_file = PostsWithCollectionAndFile.new
  end

  # GET /posts_with_collection_and_files/1/edit
  def edit
  end

  # POST /posts_with_collection_and_files
  def create
    @posts_with_collection_and_file = PostsWithCollectionAndFile.new(posts_with_collection_and_file_params)

    if @posts_with_collection_and_file.save
      redirect_to @posts_with_collection_and_file, notice: 'Posts with collection and file was successfully created.'
    else
      render action: 'new'
    end
  end

  # PATCH/PUT /posts_with_collection_and_files/1
  def update
    if @posts_with_collection_and_file.update(posts_with_collection_and_file_params)
      redirect_to @posts_with_collection_and_file, notice: 'Posts with collection and file was successfully updated.'
    else
      render action: 'edit'
    end
  end

  # DELETE /posts_with_collection_and_files/1
  def destroy
    @posts_with_collection_and_file.destroy
    redirect_to posts_with_collection_and_files_url, notice: 'Posts with collection and file was successfully destroyed.'
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_posts_with_collection_and_file
      @posts_with_collection_and_file = PostsWithCollectionAndFile.find(params[:id])
    end

    # Only allow a trusted parameter "white list" through.
    def posts_with_collection_and_file_params
      params[:posts_with_collection_and_file]
    end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
uploadcare-rails-1.2.1 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.2.0 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.2.0.pre.alpha3 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.2.0.pre.alpha spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.1.1 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.1.0 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.6 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.5 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.4 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.3 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.2 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb
uploadcare-rails-1.0.1 spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb