O'Reilly logo

Crafting Rails 4 Applications, 2nd Edition by José Valim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Revisiting the Rendering Stack

In Understanding the Rails Rendering Stack, we saw that the main responsibility of the Rails controllers rendering stack is to normalize options and send them to an instance of ActionView::Renderer. When invoked, the renderer receives an instance of ActionView::Base called the view context, and a hash of normalized options used to find, compile, and render a specific template.

Whenever we render a template in Rails, its source must first be compiled into executable Ruby code. Every time some Ruby code is executed, its execution happens inside a given context and, in a Rails application, views are executed inside the view context object. All helpers available in our templates, such as form_for and link_to, are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required