Sha256: 512e5678fca5210ee2efe8c77301e09b1e41ee0b5f4e47425c46378233106012

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 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 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.1.7 app/helpers/adminpanel/router_helper.rb
adminpanel-2.1.6 app/helpers/adminpanel/router_helper.rb
adminpanel-2.1.5 app/helpers/adminpanel/router_helper.rb
adminpanel-2.1.3 app/helpers/adminpanel/router_helper.rb
adminpanel-2.1.2 app/helpers/adminpanel/router_helper.rb
adminpanel-2.1.1 app/helpers/adminpanel/router_helper.rb