Skip to content
tablatom edited this page Sep 12, 2010 · 21 revisions

This page provides a place to collect all the issues people are hitting with upgrading their apps to Hobo 0.8. Feel free to add you own tips, but remember that you’ll confuse people if the issue was in fact peculiar to yourself! If you’re unsure, try posting on the Hobo Users forum first.

Generators

You need to run some generators again. Be careful not to overwrite your code! The ‘d’ option to see the differences is useful. You might want (with the user model in particular) to just create a new blank Hobo app with the hobo command and compare the files manually. Run these generators:


./script/generate hobo
./script/generate hobo_rapid
./script/generate hobo_user_model user
./script/generate hobo_front_controller front

The <page> tag

<page> has been greatly simplified. There’s now only one parameter for the main content section – <content:>

<page> no longer provides <content-header:> and <content-body:> parameters.

However, the standard (now generated) pages do provide both content-header and content-body parameters. Look at the source in app/views/taglibs/auto/rapid/pages.dryml to see what’s going on.

Extending tags

Extending existing tags works differently now.

<def tag="foo" extend-with="baa"> and <foo-without-baa> are gone and will give you an error

instead use:

<extend tag="foo"> and <old-foo>

Polymorphic tags

Polymorphic tags now support a “base definition” which handles the stuff common to all type-specific variations, so e.g. you can do this:

<def tag="card" for="Product"><card merge> ... </card></def>

That call to <card> is not an infinite recursive loop – it will give you the basic card structure.

<collection> is not polymorphic anymore.

So if you have things like

<def tag="collection" for="Product">...

You need to remove that and instead put the markup directly where it’s being used, or define your own tag with it’s own distinct name.

Collection actions are gone, replaced by “owner actions”

Say you have a Post that has_many :comments. In 0.7.5 Hobo would give you pages at

/posts/123/comments and /posts/123/comments/new

They would go to the methods comments and new_comment on PostsController.

Those pages and actions will be gone.

In Hobo 0.8 you need to add a declaration to CommentsController:

auto_actions_for :post, [:index, :new, :create]

Those will be at the same URLs as above, but routed to index_for_post, new_for_post and create_for_post on the comments controller.

See the agility tutorial for some examples.

:managed => true is gone

Rails has this bevhavior by default now – just get rid of this option if you have it

Subsites

If the app has one or more subsites (e.g. admin),

Subsite taglibs have the _site suffix now:

mv app/views/taglibs/admin.dryml app/views/taglibs/admin_site.dryml

There is now a taglib that is for the non-subsite parts of your app:

mv app/views/taglibs/application.dryml app/views/taglibs/front_site.dryml

application.dryml is the global taglib for tags needed across subsites.

touch app/views/taglibs/application.dryml

Move any tags globally in there.

Note that the new hobo_subsite generator does all this for you – this is just if you have existing subsites

Then…

Add to application.dryml (or front_site.dryml if you have subsites):


<include src="taglibs/auto/rapid/cards"/>
<include src="taglibs/auto/rapid/pages"/>
<include src="taglibs/auto/rapid/forms"/>

For each additional sub-site (e.g. admin) include the sub-site specific auto taglibs in the sub-site’s shared taglib, e.g. in app/views/taglibs/admin_site.dryml:


<include src="taglibs/auto/admin/rapid/cards"/>
<include src="taglibs/auto/admin/rapid/pages"/>
<include src="taglibs/auto/admin/rapid/forms"/>

<nav> is gone

It was just a <div class="nav"> anyway. Remove any calls to it, or redefine it yourself.

<collection-preview> is gone

Replace occurrences with something like:


<div class="collection-preview">
 <header>
   <h3>Your title</h3>
 </header>
 <collection/>
</div>

<ul> is now a static tag

Replace:


<ul with="&...">
 <li:>...</li:>
</ul>

with:


<ul>
 <li repeat="&...">...</li>
</ul>

Hobo.applyEvents (javascript) is gone

Remove <body onload="Hobo.applyEvents();"> if called directly in any views

Clone this wiki locally