I like that! :finalize => true works for me (I'd rather not make the API expose the reason for the API)
Sent from my iPhone On Oct 10, 2010, at 12:11 PM, Robert Pankowecki <[email protected]> wrote: >> Anyway, I kinda like "provide", but I like "final_content_for" >> better. Mostly, I feel like the call to this method should *finalize* >> the content for that key, meaning you could do something like this: >> >> content_for :foo, "bar" >> final_content_for :foo, "baz" >> >> Then if you called "content_for :foo" or "final_content_for :foo" >> again, Rails would raise an exception. Calling "yield :foo" would >> output "barbaz". >> >> Otherwise, content_for and provide (or whatever it ends up being >> called) could be kept entirely separate, though I feel that could be >> somewhat confusing for people, but maybe I'm wrong (?). >> >> What are people's thoughts re: name and re: behavior wrt content_for >> and the new, automatic-flushing api? > > It would be awesome to have it working as you described. +1. > > About naming and api; how about: > > content_for :foo, "bar" > > and then: > > content_for :foo, "baz", :flush => true > or > content_for :foo, "baz", :finalize => true > or > content_for :foo, "baz", :freeze => true > > Robert Pankowecki > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
