Ride Some Rails with The Rails View – #bookreview #in #rails #programming

The Rails View: Create a Beautiful and Maintainable User Experience
John Athayde and Bruce Williams
(Pragmatic Bookshelf, paperback, list price $35.00)

Rails was created in 2004 “and the web discovered the MVC (model-view-controller) pattern in earnest, which brought a whole new level of productivity and fun to a world of developers and designers,” the authors of this “very ambitious” book declare.

They note that many books “provide a firm foundation for writing controllers and models (which benefit greatly from being written top-to-bottom in plain Ruby), but when it comes to views—that meeting place of Ruby, HTML, JavaScript, and CSS (not to mention developers and designers)—what’s a disciplined craftsman to do?”

Athayde and Williams have written this views-centric book to help “widen the discussion of Rails best practices to include solid, objective principles we can follow when building and refactoring views.”

They add: “Many developers are uneasy around the view layer” and frequently in a hurry to just get out of it, leaving it “easy for the view layer to become a no-man’s land that no one owns or adequately polices or a junkyard that no one feels safe to walk through.”

The 245-page book’s nine chapters are well-written and adequately illustrated with code examples, screen shots and other illustrations, including highlighted tips.

The book follows a structure where chapters build upon the content of the previous chapter. The chapters are:

  • Creating an Application Layout
  • Improving Readability
  • Adding Cascading Style Sheets
  • Adding JavaScript
  • Building Maintainable Forms
  • Using Presenters
  • Handing Mobile Views
  • Working with Email
  • Optimizing Performance

One of the appendices is titled “The Rails View Rules.” It is a handy list of 10 “rules of thumb” when doing development work.

The book is aimed mostly at designers working with Rails and Rails developers working in the view layer. But newcomers curious about Rails or just getting started with Rails can learn from it, too.

The Rails View was built on top of Rails 3.2.1 and Ruby 1.9.3 and should be compatible with future stable releases for quite some time,” the authors say.

If you try to use earlier versions, you may run into some problems, they caution. “Much of the content and code would need to be modified to work with some earlier versions due to our coverage of the Rails 3.1+ asset pipeline and use of the new Ruby 1.9 Hash literal syntax.”

Si Dunn

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s