Given your troubles, you might want to remove the automatic hobo
routes and manually specify them.  A little ugly but will let you
specify the order of routing exactly.

On May 27, 10:05 am, Chris Apolzon <[email protected]> wrote:
> So....I'm really having trouble with this.  If I try flip-flopping the route
> declarations, I either get errors from dryml (<index-page/>) because the
> path methods/variables are missing or the route is misinterpreted as a show
> route (with an id of 'received' -- my custom route).  This has all led me to
> read the model_router.rb file in the Hobo gem.  The comment regarding ticket
> #251 for disambiguating nil ids (and #252 which is marked wontfix).  Is this
> likely related or am I barking up the wrong tree?
>
> On Wed, May 26, 2010 at 4:48 PM, Chris Apolzon <[email protected]> wrote:
> > Quick follow-up: Yes, this workaround does break all the existing chris#
> > routes so I would love to hear how to declare the lifecycle routes manually.
>
> > On Wed, May 26, 2010 at 4:24 PM, Chris Apolzon <[email protected]> wrote:
>
> >> As it turns out, if you try to define some custom routes for a model
> >> with a lifecycle:
>
> >>  map.resources :manuscripts, :collection => { :chris1 => :get,
> >>                                                :chris2 => :get,
> >>                                                :chris3 => :get,
> >>                                                :chris4 => :get,
> >>                                                :chris5 => :get
> >>                                            }
>
> >>  lifecycle do
> >>    state :assigned, :reviewing, :completed
> >>    create :assign, :become => :assigned, :available_to =>
> >> "User", :user_becomes => :editor
> >>    transition :review, { :assigned => :reviewing }, :available_to =>
> >> "User"
> >>    transition :complete, { :reviewing => :completed }, :available_to
> >> => "User"
> >>  end
>
> >> it greatly confuses the routing mechanism.  I declared my custom
> >> resources before Hobo.add_routes (which I'm nearly positive I read as
> >> the correct way to do custom routes in hobo), which results in
> >> "assign" (the create lifecycle action) being interpreted as an index
> >> and rails attempts to load the show action.  If you declare your
> >> custom resources AFTER Hobo.add_routes, the lifecycle stuff works
> >> fine....I haven't gotten a chance to investigate if this will cause my
> >> custom routes to break.
>
> >> I'm just wondering if this is a bug, or if there's a way to map the
> >> lifecycle routes by hand when adding custom routes.  Would they
> >> be :member declarations?
>
> >> Thanks.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Hobo Users" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<hobousers%[email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/hobousers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to