HOME JAVA & JEE OPEN SOURCE .NET WEB & RIA CLOUD & GRID ARCHITECTURE & DDD AGILE PM & SCRUM AGILE TESTING & BDD OS, MOBILE & SERVER  
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
Digg! StumbleUpon
SPONSORS
Manning Publications Co.
Skills Matter Ltd
RIA, AJAX & WEB PODCASTS
Colin Howe:Re-writing Java classes in Scala - and making your code lovely, Re-writing Java classes in Scala - and m
Colin Howe : 8th Feb 2010
View Podcast: Re-writing Java classes in Scala - and making your code lovely,
Gojko Adzic:Using Cucumber for BDD and Agile Acceptance Testing, Using Cucumber for BDD and Agile accepta
Gojko Adzic : 4th Feb 2010
View Podcast: Using Cucumber for BDD and Agile Acceptance Testing,
Rob Nicholson:How is the world of IT going to change over the next two, five and ten years?, Rob Nicholson: Global Technology Outlook
Rob Nicholson : 27th Jan 2010
Podcast Coming Soon: How is the world of IT going to change over the next two, five and ten years?,
Mark Evans:Dragonfly, Dragonfly
Mark Evans : 13th Jan 2010
View Podcast: Dragonfly,
Daniel  Lucraft:Redcar, Redcar
Daniel Lucraft : 13th Jan 2010
View Podcast: Redcar,
Emma McGrattan:Waking up to the New Economics of IT, Waking up to the New Economics of IT
Emma McGrattan : 15th Dec 2009
View Podcast: Waking up to the New Economics of IT,
Peter Lubbers:BUILDING REAL-TIME APPLICATIONS WITH HTML5 WEBSOCKETS , REAL-TIME APPLICATIONS WITH HTML5
Peter Lubbers : 9th Dec 2009
Podcast Coming Soon: BUILDING REAL-TIME APPLICATIONS WITH HTML5 WEBSOCKETS ,
Alex  Young :Domain Driven Design, DDD
Alex Young : 9th Dec 2009
View Podcast: Domain Driven Design,
Rob  Holland:Javascript Stories, Javascript Stories
Rob Holland : 9th Dec 2009
View Podcast: Javascript Stories,
Russ Miles:ParkBench Panel Discussion with Pizza & Drinks, ParkBench Panel Discussion, Pizza & drin
Russ Miles : 9th Dec 2009
View Podcast: ParkBench Panel Discussion with Pizza & Drinks,
Guillaume LaForge:Groovy, to infinity and beyond!, Groovy & Grails eXchange Keynote
Guillaume LaForge : 9th Dec 2009
View Podcast: Groovy, to infinity and beyond!,
Russel Winder:Gant, the lightweight and Groovy targeted scripting framework, Gant, the Groovy targeted scripting fram
Russel Winder : 9th Dec 2009
View Podcast: Gant, the lightweight and Groovy targeted scripting framework,
Tareq Abedrabbo:Creating easy and secure SOAPful Web Services, Easy & secure SOAPful Web Services
Tareq Abedrabbo : 9th Dec 2009
View Podcast: Creating easy and secure SOAPful Web Services,
Venkat Subramaniam:Building DSLs: Marriage of High Essence and Groovy Metaprogramming, Building DSLs & Groovy Metaprogramming
Venkat Subramaniam : 9th Dec 2009
View Podcast: Building DSLs: Marriage of High Essence and Groovy Metaprogramming,
Tomas Lin:Building Killer RIAs with Flex and Grails, Building Killer RIAs with Flex and Grail
Tomas Lin : 9th Dec 2009
View Podcast: Building Killer RIAs with Flex and Grails,
OTHER RIA, AJAX & WEB EVENTS
Dojo Connect, Dojo Connect
CONFERENCE (3 DAYS)
Online, Wednesday, February 10th BOOK NOW!
London Ruby User Group:Lightning Talk Evening, London Ruby User Group
FREE EVENT: Lightning Talk Evening
London, Wednesday, February 10th
London Geek Nights:Hydras and Hypermedia , London Geek Nights
FREE EVENT: Hydras and Hypermedia
London, Thursday, February 11th
Adobe RIA User Group:Flex and Spring Integration:Introducing Spring BlazeDS Integration, Adobe RIA User Group
FREE EVENT: Spring Integration
London, Wednesday, February 17th
JAX London 2010, JAX London 2010
CONFERENCE (3 DAYS)
London, Monday, February 22nd BOOK NOW!
Peter Lubbers:HTML5 Communication: Using Web Sockets and more to build real-time Web applications,  HTML5 Communication: Using Web Sockets and more to
3 DAY COURSE. Featuring Peter Lubbers
London, Wednesday, February 24th
Peter Lubbers:HTML5 Communication: Using Web Sockets and more to build real-time Web applications,  HTML5 Communication: Using Web Sockets and more to
3 DAY COURSE. Featuring Peter Lubbers
Paris, Monday, March 1st
Sam Foster:Dojo Workshop,  Dojo Workshop
1 DAY COURSE. Featuring Sam Foster
London, Friday, March 5th
© Copyright 2003-2010, Skills Matter Ltd
  Web development by You In Control
About Us  Jobs  Find Us  Meeting & Training Rooms  Newsletter  Community  Community-FR  Apress  1st Teach  Jobs: Sales Executive  Jobs: Student Podcaster  Jobs: - Facilities Sales  jobs - marketing assistant  Save Bletchley Park  Spring Certification