I’m here at The Rails Edge Conference in Denver and will summarize some of the talks. Let me take a moment to put in a personal recommendation for this group of speakers and the Pragmatic Studio conferences. They are a professional group who put on a well run conference. Highly recommended.
Building UI Frameworks – Bruce Williams
Bruce talked about the pain that views impose on developers and how to help yourself in the Rails environment avoid some of the pain. Bruce noted that this is not a Rails problem or an MVC problem, it is just a fact that views are hard to deal with. They mix a developer and designer’s frame of mind in a single place which makes for frustrations and challenges.
The case for frameworks
Frustrations and challenges
Yet, because views are the most visible part of MVC apps, they are the user’s experience and they are the most contenious part of the application when trying to gain concensus from a development team.
– “Traditional” DRYing of views is accomplished by helpers, “block” helpers, and partials and cover the “V”(iew) part of MVC.
– “REST” DRYing of views is accomplished by simply_* (such as simply_RESTful, simply_HELPful) – cover the M and V.
– “DRY Interaction/Views” – DSL for Controllers and Plugin with Controller.
Recommendations from Bruce
– Use Edge Rails to stay current (don’t use in production though)
– Use simply_helpful
– Use other plugins and make your own
– Use intermediate objects (for complex views)
– Make your own FormBuilders (form_for DSLs for free)
– Other Ruby projects (get to know Ruby!!)
– Learn to Metaprogram!
It’s complex, not well documented, stuff so you take on some risks; yet can be well worth the effort.
– If you want to become a better and more efficient Rails developer, Follow Bruce’s recommendations. The recommendation to use simply_restful and simply_helpful is something you can implement with little learning curve and see great benefit. Look into these in more detail and you will see you have no reason not to be using them to make your views cleaner and to save you the headaches of managing DOM id naming conventions.
– Also, you and I, as Rails developers should be thinking about ways to solve the problems Bruce talked about and remove some of the PAIN of views. Think about what you can do to help views suck less.