Search Books

The Rails View: Create a Beautiful and Maintainable User Experience

Author Williams, Bruce
Publisher Pragmatic Bookshelf
📄 Viewing lite version Full site ›
🌎 Shop on Amazon — choose country
2.68 35.00 USD
🛒 Buy New on Amazon 🇺🇸

✓ In Stock.

Share:
Book Details
ISBN / ASIN1934356875
ISBN-139781934356876
AvailabilityIn Stock.
Sales Rank3,969,034
MarketplaceUnited States 🇺🇸

Description

The Rails View: Rules for the View

  1. Our markup should have meaning. We write templates using semantic HTML.
  2. Our style sheets should handle presentation. We don’t use markup to style or use images when CSS will do.
  3. Our templates should be free of client-side code. We unobtrusively attach behavior from our JavaScript files.
  4. Our templates should be easy to read. We consistently indent correctly using spaces instead of tabs, type lines no longer than eighty characters, and extract complex logic to helpers and presenters.
  5. Our templates should be easy to find. We use standard naming conventions and place them in the directory for the related resource (or the layout).
  6. Our markup should be easy for the entire team to modify. We prefer rendering partials over generating markup from Ruby code.
  7. Our technology choices should help, not hinder, the team. We use the templating language and tools that work best for all of us.
  8. Our designs for the Web should work on a variety of devices and browsers. We build for the simplest interactions first and support progressive enhancement.
  9. Our designs for email must work for a wide range of providers. We use HTML tables and images as necessary and always provide a plain-text alternative.
  10. Our application should perform as well as it needs to, when it needs to. We implement the most elegant approach first, then we optimize when necessary.