Sha256: dd2e9780f9c79e105a862c8f0a189b586808ac4ac3ebaa8a176e66688ba852c2

Contents?: true

Size: 817 Bytes

Versions: 49

Compression:

Stored size: 817 Bytes

Contents

module Rao
  module ResourcesController::RestResourceUrlsConcern
    extend ActiveSupport::Concern

    included do
      helper_method :new_resource_path
      helper_method :collection_path
      helper_method :resource_path
      helper_method :edit_resource_path
    end

    private

    def new_resource_path
      resource_router.send(:url_for, { action: :new, only_path: true })
    end

    def collection_path
      resource_router.send(:url_for, { action: :index, only_path: true })
    end

    def resource_path(resource)
      resource_router.send(:url_for, { action: :show, id: resource, only_path: true })
    end

    def edit_resource_path(resource)
      resource_router.send(:url_for, { action: :edit, id: resource, only_path: true })
    end

    def resource_router
      self
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
rao-resources_controller-0.0.51.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.50.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.49.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.48.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.47.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.46.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.45.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.44.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.43.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.42.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.41.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.40.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.39.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.38.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.37.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.36.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.35.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.34.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.33.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb
rao-resources_controller-0.0.32.pre app/concerns/rao/resources_controller/rest_resource_urls_concern.rb