I highly recommend the latest Hobo book: 
http://hobocentral.net/manual/books - walks you through and explains most 
of what you are asking. It's not Rails 4 or Hobo 2.x yet, but most of the 
things still apply. Also, go through the Agility tutorial first, if you 
haven't yet.

But yes, you are correct, basically Hobo tries to look for an action page 
in the app/views directory first, and then if it does not find that, 
pretends it contained an "<#{action name}-page>" call (e.g. for #show, a 
"<show-page>" call), then executes that.

So to customize behaviour, you can either put your logic inside the 
<show-page> tag itself (somewhere in a tag definition file under 
app/views/taglibs), or you can put your logic into 
"(app/views/#{controllername}/#{actionname}.dryml" as DRYML custom view. 
Either way, can do whatever you want, draw on as much or as little 
functionality as you want. If you put "Hello World!" and nothing else into 
that .dryml file, then that's what the action will return to the browser. 
But usually it contains a call to the respective <#{actionname}-page> tag 
(e.g. for a #show action <show-page>, for #edit <edit-page>, for #foobar 
<foobar-page>, etc.), just strongly parameterized inside.

2015. június 30., kedd 5:13:58 UTC+2 időpontban Paul Howson a következőt 
írta:
>
> Hi Ignacio and others,
>
> On a roll with a few questions here.
>
> I'm curious about how Hobo connects a controller action to a Dryml tag. I 
> know how it works in Rails. It looks for a view inside a folder named after 
> the controller, etc. But that is not required when using Hobo. Seems if the 
> view is not present, then Hobo will go looking for an equivalent Dryml tag, 
> such as:
>
> <def tag="index-page" for="Brand">
>
> …for the index action in a BrandsController.
>
> It seems Hobo pre-compiles all the Dryml tag library definitions and then 
> searches the resulting list for such a tag. If there is no such tag 
> matching "Brand", then will it use a generic tag such as:
>
> <def tag="index-page">   ?
>
> What about custom actions? If I have an action called "myaction", then 
> will Hobo look for a tag named "myaction-page" ?
>
> Is this documented clearly somewhere, or can you explain? And where in 
> Hobo is the code which does this matching?
>
> Paul
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to