|
|
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
|
ABOUT THE LONDON RUBY USER GROUP
|
LRUG is the London Ruby User Group; a community of ruby developers based in and around London. We meet up at least once a month; on the 2nd Wednesday of the month we have meetings with talks, demos and such-like and then we have pub-based meetups organised on an ad-hoc basis (roughly half-way between meetings).
More about the London Ruby User Group
|
|
PODCAST A MODULAR APPROACH TO VIEWS
This session took part at the LRUG April. You can view the other 2 podcasts here.
|
JAVASCRIPT & HTML5 COURSES
|
JAVASCRIPT & HTML5 PODCASTS
|
OTHER JAVASCRIPT & HTML5 EVENTS
|
Official RNIB Accessibility Hackathon
CONFERENCE (2 DAYS)
London, Saturday, February 11th
BOOK NOW!
|
|
Russel Winder's Python Workshop
4 DAY COURSE. Featuring Russel Winder London, Monday, February 13th
|
|
Coding Kata
FREE EVENT:
In The Brain of Damjan Vujnovic
London, Wednesday, February 15th
|
|
London Ruby User Group
FREE EVENT:
LRUG lightning
London, Tuesday, February 21st
|
|
QCon London 2012
CONFERENCE (3 DAYS)
London, Wednesday, March 7th
BOOK NOW!
|
|
Elevate Events
FREE EVENT:
elevate-launch-event
London, Wednesday, March 7th
|
|
Peter Lubbers' HTML5 Fast Track Course
2 DAY COURSE. Featuring Peter Lubbers New York, Wednesday, March 14th
|
|
Peter Lubbers' HTML5 “Fast Track”
2 DAY COURSE. Featuring Peter Lubbers London, Tuesday, March 20th
|
|
|
|