Method: Vedeu::DSL::Composition#template_for
- Defined in:
- lib/vedeu/dsl/composition.rb
#template_for(name, filename, object = nil, options = {}) ⇒ Vedeu::Views::Views<Vedeu::Views::View>
TODO:
More documentation required.
Load content from an ERb template.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/vedeu/dsl/composition.rb', line 95 def template_for(name, filename, object = nil, = {}) fail Vedeu::Error::MissingRequired, 'Cannot render template without the name of the ' \ 'view.'.freeze unless name fail Vedeu::Error::MissingRequired, 'Cannot render template without a filename.'.freeze unless filename .merge!(name: name) content = Vedeu::Templating::ViewTemplate.parse(object, filename, ) # lines = Vedeu::Output::Wordwrap.for(content, options) new_model = model.member.build(template_attributes(name, content)) model.add(new_model) end |