Module: Theme::Assets::Render
- Defined in:
- lib/theme/assets/render.rb
Class Method Summary collapse
Instance Method Summary collapse
- #partial(file, options = {}) ⇒ Object
- #render(file, options = {}) ⇒ Object
- #view(file, options = {}) ⇒ Object
Class Method Details
.setup(app) ⇒ Object
4 5 6 7 |
# File 'lib/theme/assets/render.rb', line 4 def self.setup app app.settings[:render] ||= {} load_engines end |
Instance Method Details
#partial(file, options = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/theme/assets/render.rb', line 23 def partial file, = {} file.gsub! PARTIAL_REGEX, '_\1' path = "#{settings[:render][:views] || Theme.config.view_path}" Theme.load_file "#{path}/#{file}", , self end |
#render(file, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/theme/assets/render.rb', line 14 def render file, = {} path = "#{settings[:render][:views] || Theme.config.view_path}" layout_path = settings[:layout_path] || Theme.config.layout_path layout = "#{layout_path}/#{settings[:render][:layout] || Theme.config.layout}" content = Theme.load_file "#{path}/#{file}", , self [:content] = content Theme.load_file layout, , self end |