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