> Beyond that you'll need to get rid of the initial '---' and then indent > properly. Facets has the #tabto method you can use, though I'm not sure in where > you have to put the code: > > require 'facet/string/tabto' > > class String > def to_yaml_fragment(n) > self.to_yaml.sub('---','').tabto(n) > end > end > > then > > first: > id: 1 > filename: dummy1.png > params: > <%= { :dates => ['2006-04-20'], :currencies => ['USD'] > }.to_yaml_fragment(4) %> > > Or there abouts should work. (There's also #tab and #indent methods too, btw). > > T. Thanks for pointing me to this Facets library ! -- Martins