Module: Cms::Behaviors::ClassMethods
- Defined in:
- lib/cms/behaviors/rendering.rb
Instance Method Summary collapse
- #helper_class ⇒ Object
- #helper_path ⇒ Object
-
#instance_variable_name_for_view ⇒ Object
This will be the used as the name of instance variable that will be available in the view.
-
#ivars_to_ignore ⇒ Object
Instance variables that will not be copied from the renderable to the view.
- #renderable? ⇒ Boolean
-
#template_path ⇒ Object
This is where the path to the template.
Instance Method Details
#helper_class ⇒ Object
74 75 76 |
# File 'lib/cms/behaviors/rendering.rb', line 74 def helper_class "Cms::#{name}Helper".constantize end |
#helper_path ⇒ Object
70 71 72 |
# File 'lib/cms/behaviors/rendering.rb', line 70 def helper_path "app/helpers/cms/#{name.underscore}_helper.rb" end |
#instance_variable_name_for_view ⇒ Object
This will be the used as the name of instance variable that will be available in the view. The default value is “@renderable”
66 67 68 |
# File 'lib/cms/behaviors/rendering.rb', line 66 def instance_variable_name_for_view @instance_variable_name_for_view ||= "@renderable" end |
#ivars_to_ignore ⇒ Object
Instance variables that will not be copied from the renderable to the view
86 87 88 |
# File 'lib/cms/behaviors/rendering.rb', line 86 def ivars_to_ignore ['@controller', '@_already_rendered'] end |
#renderable? ⇒ Boolean
60 61 62 |
# File 'lib/cms/behaviors/rendering.rb', line 60 def renderable? true end |
#template_path ⇒ Object
This is where the path to the template. The default is based on the class of the renderable, so if you have an Article that is renderable, the template will be “articles/render”
81 82 83 |
# File 'lib/cms/behaviors/rendering.rb', line 81 def template_path "cms/#{name.underscore.pluralize}/render" end |