Module: Controller::ResourceUrlsConcern
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/concerns/controller/resource_urls_concern.rb
Instance Method Summary collapse
- #collection_path ⇒ Object
- #edit_resource_path(resource) ⇒ Object
- #new_resource_path ⇒ Object
- #resource_path(resource) ⇒ Object
- #to_param_method ⇒ Object
Instance Method Details
#collection_path ⇒ Object
12 13 14 |
# File 'app/controllers/concerns/controller/resource_urls_concern.rb', line 12 def collection_path url_for(controller: controller_path, action: :index, only_path: true) end |
#edit_resource_path(resource) ⇒ Object
20 21 22 |
# File 'app/controllers/concerns/controller/resource_urls_concern.rb', line 20 def edit_resource_path(resource) url_for(controller: controller_path, action: :edit, id: resource.send(to_param_method), only_path: true) end |
#new_resource_path ⇒ Object
16 17 18 |
# File 'app/controllers/concerns/controller/resource_urls_concern.rb', line 16 def new_resource_path url_for(controller: controller_path, action: :new, only_path: true) end |
#resource_path(resource) ⇒ Object
24 25 26 |
# File 'app/controllers/concerns/controller/resource_urls_concern.rb', line 24 def resource_path(resource) url_for(controller: controller_path, action: :show, id: resource.send(to_param_method), only_path: true) end |
#to_param_method ⇒ Object
28 29 30 |
# File 'app/controllers/concerns/controller/resource_urls_concern.rb', line 28 def to_param_method :to_param end |