module Cell::ViewModel::TemplateFor
Public Instance Methods
find_template(options)
click to toggle source
# File lib/cell/view_model.rb, line 158 def find_template(options) template_options = template_options_for(options) # imported by Erb, Haml, etc. # required options: :template_class, :suffix. everything else is passed to the template implementation. view = options[:view] prefixes = options[:prefixes] suffix = template_options.delete(:suffix) view = "#{view}.#{suffix}" template_for(prefixes, view, template_options) or raise TemplateMissingError.new(prefixes, view) end
template_for(prefixes, view, options)
click to toggle source
# File lib/cell/view_model.rb, line 170 def template_for(prefixes, view, options) # we could also pass _prefixes when creating class.templates, because prefixes are never gonna change per instance. not too sure if i'm just assuming this or if people need that. # Note: options here is the template-relevant options, only. self.class.templates[prefixes, view, options] end