Sha256: b80410580ed6d5089e5477ac9e32409a2ed3329ea4d7980d1c617f338fdd5f01

Contents?: true

Size: 1.12 KB

Versions: 14

Compression:

Stored size: 1.12 KB

Contents

module Adminpanel
  module RouterHelper
    def gallery_is_sortable?(resource)
      resource_class(resource).has_sortable_gallery?
    end

    def sortable_galleries(resource)
      resource_class(resource).sortable_galleries
    end

    def resources_parameters(resource)
      resource_class(resource).routes_options
    end

    def has_fb_share?(resource)
      resource_class(resource).fb_share?
    end

    def has_gallery?(resource)
      resource_class(resource).has_gallery? || resource_class(resource).has_trix_gallery?
    end

    def resource_is_sortable?(resource)
      resource_class(resource).is_sortable?
    end

    def member_routes(resource)
      resource_class(resource).member_routes
    end

    def collection_routes(resource)
      resource_class(resource).collection_routes
    end

    def rest_path_names
      {
        path_names: {
          new: I18n.t('routes.new'),
          edit: I18n.t('routes.edit'),
          show: I18n.t('routes.show')
        }
      }
    end

    private

      def resource_class(resource)
        "adminpanel/#{resource.to_s.singularize}".classify.constantize
      end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adminpanel-3.6.1 app/helpers/adminpanel/router_helper.rb
adminpanel-3.6.0 app/helpers/adminpanel/router_helper.rb
adminpanel-3.5.1 app/helpers/adminpanel/router_helper.rb
adminpanel-3.5.0 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.7 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.6 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.5 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.4 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.3 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.2 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.1 app/helpers/adminpanel/router_helper.rb
adminpanel-3.4.0 app/helpers/adminpanel/router_helper.rb
adminpanel-3.3.4 app/helpers/adminpanel/router_helper.rb
adminpanel-3.3.3 app/helpers/adminpanel/router_helper.rb