Sha256: 0a0664679c2c81e1a37c824fc06f8709eefac1d7e0fa93c2393880c98a1f35f4

Contents?: true

Size: 677 Bytes

Versions: 21

Compression:

Stored size: 677 Bytes

Contents

class FeaturedWorksController < ApplicationController

  def create
    authorize! :create, FeaturedWork
    @featured_work = FeaturedWork.new(generic_file_id: params[:id])

    respond_to do |format|
      if @featured_work.save
        format.json { render json: @featured_work, status: :created }
      else
        format.json { render json: @featured_work.errors, status: :unprocessable_entity }
      end        
    end
  end

  def destroy
    authorize! :destroy, FeaturedWork
    @featured_work = FeaturedWork.find_by(generic_file_id: params[:id])
    @featured_work.destroy
      
    respond_to do |format|
      format.json { head :no_content }
    end
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sufia-6.2.0 app/controllers/featured_works_controller.rb
sufia-6.1.0 app/controllers/featured_works_controller.rb
sufia-5.0.0 app/controllers/featured_works_controller.rb
sufia-6.0.0 app/controllers/featured_works_controller.rb
sufia-6.0.0.rc4 app/controllers/featured_works_controller.rb
sufia-6.0.0.rc3 app/controllers/featured_works_controller.rb
sufia-5.0.0.rc1 app/controllers/featured_works_controller.rb
sufia-6.0.0.rc2 app/controllers/featured_works_controller.rb
sufia-6.0.0.rc1 app/controllers/featured_works_controller.rb
sufia-4.3.1 app/controllers/featured_works_controller.rb
sufia-6.0.0.beta1 app/controllers/featured_works_controller.rb
sufia-4.2.0 app/controllers/featured_works_controller.rb
sufia-4.1.0 app/controllers/featured_works_controller.rb
sufia-4.0.1 app/controllers/featured_works_controller.rb
sufia-4.0.0 app/controllers/featured_works_controller.rb
sufia-4.0.0.rc2 app/controllers/featured_works_controller.rb
sufia-4.0.0.rc1 app/controllers/featured_works_controller.rb
sufia-4.0.0.beta4 app/controllers/featured_works_controller.rb
sufia-4.0.0.beta3 app/controllers/featured_works_controller.rb
sufia-4.0.0.beta2 app/controllers/featured_works_controller.rb