Module: ActionController::PartialHelper
- Defined in:
- lib/vex/action_controller/partial_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#partial(partial, object = nil, locals = nil) ⇒ Object
partial <partial-name>, <object>, <locals> or partial <object>, <locals>.
- #partial?(*args) ⇒ Boolean
- #partial_for(name) ⇒ Object
Class Method Details
.disable_localite ⇒ Object
2 3 4 |
# File 'lib/vex/action_controller/partial_helper.rb', line 2 def self.disable_localite @no_localite = true end |
.localite? ⇒ Boolean
6 7 8 |
# File 'lib/vex/action_controller/partial_helper.rb', line 6 def self.localite? defined?(Localite) && !@no_localite end |
Instance Method Details
#partial(partial, object = nil, locals = nil) ⇒ Object
partial <partial-name>, <object>, <locals> or partial <object>, <locals>
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vex/action_controller/partial_helper.rb', line 22 def partial(partial, object=nil, locals=nil) # # set up object and locals unless partial.is_a?(String) object, locals = partial, object end if !locals && object.is_a?(Hash) locals, object = object, nil end opts = { :partial => partial_for(partial), :locals => locals } if object opts[:object] = object elsif locals && locals[:collection] opts[:collection] = locals[:collection] end render_vex_partial(opts) end |
#partial?(*args) ⇒ Boolean
46 47 48 49 50 51 |
# File 'lib/vex/action_controller/partial_helper.rb', line 46 def partial?(*args) partial *args rescue ActionView::MissingTemplate logger.debug $!.to_s nil end |