Sha256: 17fec82a50eb34cbc14aed94681a0e2abd85107b4a043b67342cad2ff2762586

Contents?: true

Size: 1000 Bytes

Versions: 6

Compression:

Stored size: 1000 Bytes

Contents

module Adminpanel
  module RouterHelper
    def get_gallery_children(resource)
      resource_class(resource).gallery_children
    end

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

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

    def has_twitter_share?(resource)
      resource_class(resource).twitter_share?
    end

    def 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

6 entries across 6 versions & 1 rubygems

Version Path
adminpanel-2.4.3 app/helpers/adminpanel/router_helper.rb
adminpanel-2.4.2 app/helpers/adminpanel/router_helper.rb
adminpanel-2.4.1 app/helpers/adminpanel/router_helper.rb
adminpanel-2.4.0 app/helpers/adminpanel/router_helper.rb
adminpanel-2.3.1 app/helpers/adminpanel/router_helper.rb
adminpanel-2.3.0 app/helpers/adminpanel/router_helper.rb