Sha256: a6fd70c26811bbc2e34852409e33ec242d607be34fd57f2b72ecf8310334bf7e
Contents?: true
Size: 1.1 KB
Versions: 38
Compression:
Stored size: 1.1 KB
Contents
require 'active_support/concern' module ResourceRow module PublishedExtensions extend ActiveSupport::Concern def column_published_actions link_path = view_context.controller.url_for(action: :toggle_published, id: resource.to_param) column(:column_published_actions) do |resource| if resource.published? view_context.link_to(link_path, class: 'btn btn-xs btn-danger btn-responsive', method: :post) do view_context.content_tag(:span, nil, class: 'glyphicon glyphicon-eye-close') + view_context.content_tag(:span, view_context.t('.unpublish', default: view_context.t('acts_as_published.actions.unpublish')), class: 'btn-text') end else view_context.link_to(link_path, class: 'btn btn-xs btn-success btn-responsive', method: :post) do view_context.content_tag(:span, nil, class: 'glyphicon glyphicon-eye-open') + view_context.content_tag(:span, view_context.t('.publish', default: view_context.t('acts_as_published.actions.publish')), class: 'btn-text') end end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems