O'Reilly logo

Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring by Chad Pytel, Tammer Saleh

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

Chapter 3. Views

The V in MVC—View in a Ruby on Rails application—is the presentation layer. The default view-rendering engine built into Ruby on Rails is ERb, and when Rails was first released, standard ERb templates were the only built-in supported type of template. As Rails has evolved, so has the capability of the View layer, expanding to include the ability to render different views based on MIME type and to include a new technology called RJS, among other changes.

Like the rest of the Rails framework, views follow convention over configuration. Rails encourages standard names and locations for view files, standard locations for helpers, conventions for common DOM elements, and so on. With this organization, everything has a place and ...

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