Blog (buffer)

@fredwu 12 years ago | 1 min read | no comments
Ever wondered how you could utilise the render method outside the context of Rails controllers and views? If you wonder why anyone would do that. Well, imagine you are building an awesome form builder, you need to output and/or store rendered partials in the buffer. How do you do that? For example, what if you want to do this in your view? <%=raw Awesome::FormBuilder.new(some_options).html %> You could do something like this: module Awesome class FormBuilder < AbstractController...