Module | Rabl::Partials |
In: |
lib/rabl/partials.rb
|
Returns source for a given relative file fetch_source("show", :view_path => "…") => "…contents…"
Returns a hash based representation of any data object given ejs template block object_to_hash(@user) { attribute :full_name } => { … } object_to_hash(@user, :source => "…") { attribute :full_name } => { … } object_to_hash([@user], :source => "…") { attribute :full_name } => { … } options must have :source (rabl file contents) options can have :source_location (source filename)