Module: Rabl::Partials
Instance Method Summary collapse
Methods included from Sources
Methods included from Helpers
#collection_root_name, #context_scope, #data_name, #data_object, #data_object_attribute, #determine_object_root, #fetch_result_from_cache, #is_collection?, #is_name_value?, #is_object?, #object_root_name, #object_to_engine, #template_cache_configured?, #view_path, #write_result_to_cache
Instance Method Details
#partial_as_engine(file, options = {}, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rabl/partials.rb', line 6 def partial_as_engine(file, = {}, &block) raise ArgumentError, "Must provide an :object option to render a partial" unless .has_key?(:object) object = .delete(:object) view_path = [:view_path] || self.view_path source, location = fetch_source(file, :view_path => view_path) = .merge(:source => source, :source_location => location, :template => file) object_to_engine(object, , &block) end |