Module: Cell::ViewModel::Partial
- Defined in:
- lib/cell/partial.rb
Overview
Allows to render global partials, for example.
render partial: "../views/shared/container"
Instance Method Summary collapse
Instance Method Details
#process_options!(options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/cell/partial.rb', line 5 def () super return unless partial = [:partial] parts = partial.split("/") view = parts.pop view = "_#{view}" view += ".#{options[:formats].first}" if [:formats] prefixes = self.class.view_paths.collect { |path| ([path] + parts).join("/") } .merge!(view: view, prefixes: prefixes) end |