You are previewing Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring.

Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring

Cover of Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring by Tammer Saleh... Published by Addison-Wesley Professional
O'Reilly logo

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 ...

The best content for your career. Discover unlimited learning on demand for around $1/day.