Module: Cms::PathHelper
- Included in:
- ApplicationController
- Defined in:
- app/helpers/cms/path_helper.rb
Instance Method Summary collapse
- #cms_connectable_path(connectable, options = {}) ⇒ Object
- #cms_index_path_for(resource, options = {}) ⇒ Object
- #cms_index_url_for(resource, options = {}) ⇒ Object
- #cms_new_path_for(resource, options = {}) ⇒ Object
- #cms_new_url_for(resource, options = {}) ⇒ Object
- #cms_revert_to_path_for(resource, options = {}) ⇒ Object
- #cms_versions_path_for(resource, options = {}) ⇒ Object
- #edit_cms_connectable_path(connectable, options = {}) ⇒ Object
Instance Method Details
#cms_connectable_path(connectable, options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/helpers/cms/path_helper.rb', line 30 def cms_connectable_path(connectable, ={}) if Portlet === connectable cms_portlet_path(connectable) else [:cms, connectable] end end |
#cms_index_path_for(resource, options = {}) ⇒ Object
3 4 5 |
# File 'app/helpers/cms/path_helper.rb', line 3 def cms_index_path_for(resource, ={}) send("cms_#{resource_collection_name(resource).pluralize}_path", ) end |
#cms_index_url_for(resource, options = {}) ⇒ Object
7 8 9 |
# File 'app/helpers/cms/path_helper.rb', line 7 def cms_index_url_for(resource, ={}) send("cms_#{resource_collection_name(resource).pluralize}_url", ) end |
#cms_new_path_for(resource, options = {}) ⇒ Object
11 12 13 |
# File 'app/helpers/cms/path_helper.rb', line 11 def cms_new_path_for(resource, ={}) send("new_cms_#{resource_collection_name(resource)}_path", ) end |
#cms_new_url_for(resource, options = {}) ⇒ Object
15 16 17 |
# File 'app/helpers/cms/path_helper.rb', line 15 def cms_new_url_for(resource, ={}) send("new_cms_#{resource_collection_name(resource)}_url", ) end |
#cms_revert_to_path_for(resource, options = {}) ⇒ Object
24 25 26 27 28 |
# File 'app/helpers/cms/path_helper.rb', line 24 def cms_revert_to_path_for(resource, ={}) .merge!(:id => resource.id) unless [:id] .merge!(:version => resource.version) unless [:version] send("revert_to_cms_#{resource_collection_name(resource)}_path", ) end |
#cms_versions_path_for(resource, options = {}) ⇒ Object
19 20 21 22 |
# File 'app/helpers/cms/path_helper.rb', line 19 def cms_versions_path_for(resource, ={}) .merge!(:id => resource.id) unless [:id] send("versions_cms_#{resource_collection_name(resource)}_path", ) end |
#edit_cms_connectable_path(connectable, options = {}) ⇒ Object
38 39 40 41 42 43 44 |
# File 'app/helpers/cms/path_helper.rb', line 38 def edit_cms_connectable_path(connectable, ={}) if Portlet === connectable edit_cms_portlet_path(connectable, ) else polymorphic_path([:edit, :cms, connectable], ) end end |