Sha256: 4708829a7341654bb87e0cb79738585c31ceca1c4ad74d0b3c4e092b34d15c47

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

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

    def sortable_gallery(resource)
      resource_class(resource).gallery_relationship
    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 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

8 entries across 8 versions & 1 rubygems

Version Path
adminpanel-2.6.1 app/helpers/adminpanel/router_helper.rb
adminpanel-2.6.0 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.5 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.4 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.3 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.2 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.1 app/helpers/adminpanel/router_helper.rb
adminpanel-2.5.0 app/helpers/adminpanel/router_helper.rb