|
|
London Ruby User Group:A Modular Approach to Views
A Modular Approach to Views
Jon Gilbraith is not keen on HTML as he finds it takes the joy out of programming and it also seems unsightly. Alternatives like Haml are a nice improvement, but with Haml things still get untidy once the logic is laid out. The standard Rails solution is Helpers Partials, which are a good way to break up the view for big partials. But for small snippets of html one has to use all sorts of weird naming and path combinations to try to sort and identify them. They often have as much or more Ruby in them than html anyway.
For these situations a helper might be a better solution. Helpers are generally used for small jobs e.g. generating a few tags. Generating html within a helper is generally quite messy. One option is to define logical chunks of a view with blocks of idiomatic Ruby. The result can be clean, clear, descriptive and dry; forcing strong modularisation which leaves cleaner and better structured markup and style, a good foundation for separating the design and development tasks, straight forward refactoring and reuse and a good foundation for fragment caching.
ABOUT JON GILBRAITH
|
Jon Gilbraith has been working on taking a modular approach to views and creating builder classes to abstract structural html and view logic into Ruby blocks.
More about Jon Gilbraith
|
|
PODCAST A MODULAR APPROACH TO VIEWS
|
|
|
|
OTHER RIA, AJAX & WEB EVENTS
|
Dojo Connect
CONFERENCE (3 DAYS)
Online, Wednesday, February 10th
BOOK NOW!
|
|
London Ruby User Group
FREE EVENT:
Lightning Talk Evening
London, Wednesday, February 10th
|
|
London Geek Nights
FREE EVENT:
Hydras and Hypermedia
London, Thursday, February 11th
|
|
Adobe RIA User Group
FREE EVENT:
Spring Integration
London, Wednesday, February 17th
|
|
JAX London 2010
CONFERENCE (3 DAYS)
London, Monday, February 22nd
BOOK NOW!
|
|
HTML5 Communication: Using Web Sockets and more to
3 DAY COURSE. Featuring Peter Lubbers London, Wednesday, February 24th
|
|
HTML5 Communication: Using Web Sockets and more to
3 DAY COURSE. Featuring Peter Lubbers Paris, Monday, March 1st
|
|
Dojo Workshop
1 DAY COURSE. Featuring Sam Foster London, Friday, March 5th
|
|
|
|