Sha256: f7c2db01ca7057c705d7c7b5efbd86fc9608c7ff3852370e90e349d62e4e6196
Contents?: true
Size: 661 Bytes
Versions: 6
Compression:
Stored size: 661 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
6 entries across 6 versions & 1 rubygems