Class Cell::View
In: lib/cell/view.rb
Parent: ::ActionView::Base

Methods

Attributes

cell  [RW] 

Public Instance methods

[Source]

    # File lib/cell/view.rb, line 25
25:     def expand_view_path(path)
26:       path = "#{cell.cell_name}/#{path}" unless path.include?('/')  
27:       path
28:     end

[Source]

    # File lib/cell/view.rb, line 15
15:     def render(options = {}, local_assigns = {}, &block)
16:       if partial_path = options[:partial]
17:         # adds the cell name to the partial name.
18:         options[:partial] = expand_view_path(partial_path)
19:       end
20:       
21:       super(options, local_assigns, &block)
22:     end
  DISCUSS: where/how do WE set template_format (render_view_for_state)?

Tries to find the passed template in view_paths. Returns the view on success- otherwise it will throw an ActionView::MissingTemplate exception.

[Source]

    # File lib/cell/view.rb, line 10
10:     def try_picking_template_for_path(template_path)
11:       self.view_paths.find_template(template_path, template_format)
12:     end

[Validate]