|
|
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
|
Object-Oriented ActionScript - Beginners
1 DAY COURSE. Paris, Tuesday, March 30th
|
|
Adobe Flex Intro
1 DAY COURSE. Paris, Tuesday, April 13th
|
|
Android Mobile App Development
3 DAY COURSE. Featuring Alan Cassar London, Wednesday, April 14th
|
|
Adobe Flex for Flash Developers
1 DAY COURSE. Paris, Monday, April 19th
|
|
Ruby on Rails Web Development
4 DAY COURSE. Featuring Andrew Chalkley Paris, Tuesday, April 20th
|
|
Android Mobile App Development
3 DAY COURSE. Paris, Wednesday, April 21st
|
|
HTML5 Communication: Using Web Sockets & more too
3 DAY COURSE. Featuring Peter Lubbers London, Wednesday, April 21st
|
|
Adobe AIR Intro
1 DAY COURSE. Paris, Monday, April 26th
|
|
|
|