Sha256: 1f07f4f7c06601c0f4dba72b6d97e500083079c7ecd9fe8cbd4644431036e3ae
Contents?: true
Size: 646 Bytes
Versions: 9
Compression:
Stored size: 646 Bytes
Contents
class LoldesignPublisher::ActivablesController < LoldesignPublisher::PublisherController respond_to :html, :json before_filter :load_resource def create if @resource.update_attribute(:active, true) render json: {message: "#{@resource.class.to_s} - #{@resource.id} activated."} else head :error end end def destroy if @resource.update_attribute(:active, false) render json: {message: "#{@resource.class.to_s} - #{@resource.id} inactivated."} else head :error end end private def load_resource @resource = params[:resource_name].classify.constantize.find params[:id] end end
Version data entries
9 entries across 9 versions & 1 rubygems