-
Notifications
You must be signed in to change notification settings - Fork 2
/
19-customizing-views-1.patch
18 lines (9 loc) · 1.25 KB
/
19-customizing-views-1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
customizing-views-1
From: Bryan Larsen <[email protected]>
# Customising views
It's pretty surprising how far you can get without even touching the view layer. That's the way we like to work with Hobo - get the models and controllers right and the view will probably get close to what you want. From there you can override just those parts of the view that you need to.
We do that using the DRYML template language which is part of Hobo. DRYML is tag based -- it allows you to define and use your own tags right alongside the regular HTML tags. Tags are like helpers, but a lot more powerful. DRYML is quite unlike other tag-based template languages, thanks to features like the implicit context and nestable parameters. DRYML is also an extension of ERB so you can still use the ERB syntax you're familiar with from Rails.
DRYML is probably the single best part of Hobo. It's very good at high-level re-use because it allows you to make very focussed changes if a given piece of pre-packaged HTML is not *quite* what you want.
A full coverage of DRYML is well beyond the scope of this tutorial. Instead we're going to take a few specific examples of changes we'd like to make to Agility, and see how they're done.
---
0 files changed, 0 insertions(+), 0 deletions(-)