Sha256: 027060356fc80289fcaa194c55520643ae498a098ebb39f865ba2fa30a91b66b
Contents?: true
Size: 468 Bytes
Versions: 38
Compression:
Stored size: 468 Bytes
Contents
module Controller module ActsAsPublishedConcern extend ActiveSupport::Concern def toggle_published @resource = load_resource @resource.toggle_published! action_taken = @resource.published? ? 'published' : 'unpublished' resource_label = @resource.try_all(*Itsf::Backend::Configuration.resource_title_methods) redirect_to :back, notice: I18n.t("acts_as_published.notices.#{action_taken}", name: resource_label) end end end
Version data entries
38 entries across 38 versions & 1 rubygems