Module: Cms::PathHelper
- Included in:
- ApplicationController
- Defined in:
- app/helpers/cms/path_helper.rb
Overview
TODO:
All methods really need to be renamed to match conventions for Engines.
In CMS::Engine, shouldn’t have cms_ in method name. From app, should be cms.xyz_path
Instance Method Summary collapse
- #cms_connectable_path(connectable, options = {}) ⇒ Object
- #cms_index_path_for(resource, options = {}) ⇒ Object
-
#cms_index_url_for(resource, options = {}) ⇒ Object
deprecated
Deprecated.
Remove all usages of this in favor of cms_index_path_for ()
- #cms_new_path_for(resource, options = {}) ⇒ Object
-
#cms_new_url_for(resource, options = {}) ⇒ Object
deprecated
Deprecated.
Remove all usages of this in favor of cms_new_path_for ()
-
#edit_cms_connectable_path(connectable, options = {}) ⇒ Object
In CMS::Engine, should be edit_connectable_path From app, should be cms.edit_connectable_path.
-
#engine_for(resource) ⇒ Object
Returns the Engine Proxy that this resource is from.
- #path_elements_for(resource) ⇒ Object
Instance Method Details
#cms_connectable_path(connectable, options = {}) ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/helpers/cms/path_helper.rb', line 26 def cms_connectable_path(connectable, ={}) if Portlet === connectable cms.portlet_path(connectable) else connectable end end |
#cms_index_path_for(resource, options = {}) ⇒ Object
8 9 10 |
# File 'app/helpers/cms/path_helper.rb', line 8 def cms_index_path_for(resource, ={}) polymorphic_path(build_path_for(resource), ) end |
#cms_index_url_for(resource, options = {}) ⇒ Object
Deprecated.
Remove all usages of this in favor of cms_index_path_for ()
13 14 15 |
# File 'app/helpers/cms/path_helper.rb', line 13 def cms_index_url_for(resource, ={}) send("#{resource_collection_name(resource).underscore.pluralize.gsub('/', '_')}_url", ) end |
#cms_new_path_for(resource, options = {}) ⇒ Object
17 18 19 |
# File 'app/helpers/cms/path_helper.rb', line 17 def cms_new_path_for(resource, ={}) new_polymorphic_path(build_path_for(resource), ) end |
#cms_new_url_for(resource, options = {}) ⇒ Object
Deprecated.
Remove all usages of this in favor of cms_new_path_for ()
22 23 24 |
# File 'app/helpers/cms/path_helper.rb', line 22 def cms_new_url_for(resource, ={}) send("new_#{resource_collection_name(resource).underscore.gsub('/', '_')}_url", ) end |
#edit_cms_connectable_path(connectable, options = {}) ⇒ Object
TODO:
Really needs to be renamed to match conventions for Engines.
In CMS::Engine, should be edit_connectable_path From app, should be cms.edit_connectable_path
37 38 39 40 41 42 43 |
# File 'app/helpers/cms/path_helper.rb', line 37 def edit_cms_connectable_path(connectable, ={}) if Portlet === connectable edit_portlet_path(connectable, ) else polymorphic_path([:edit, connectable], ) end end |
#engine_for(resource) ⇒ Object
Returns the Engine Proxy that this resource is from.
46 47 48 49 |
# File 'app/helpers/cms/path_helper.rb', line 46 def engine_for(resource) EngineHelper.decorate(resource) send(resource.engine_name) end |
#path_elements_for(resource) ⇒ Object
51 52 53 54 |
# File 'app/helpers/cms/path_helper.rb', line 51 def path_elements_for(resource) EngineHelper.decorate(resource) resource.path_elements end |