I always get this wrong the first time, too. :) a GET from model/:id/transition will return the form for the transition. a POST to model/:id/do_transition will execute the transition. Note the leading "do_"
cheers, Bryan On Jun 19, 4:24 pm, Arman <[email protected]> wrote: > I have a simple lifecycle whose create action works fine but when I > try to invoke a transition I get an error from model/:id/transition > (for example business_ownerships/1/accept): > > Unknown action > No action responded to 1. Actions: accept, access_denied, etc. > > I can't figure out why the URL isn't routed correctly. I'm on Hobo > 0.85. Any help is appreciated. > > Thanks, > Arman > > __________________________________________________________ > MODEL: > class BusinessOwnership < ActiveRecord::Base > > hobo_model # Don't put anything above this > > fields do > acknowledge :boolean > notes :text > timestamps > end > > # The 'business' that is being claimed > belongs_to :business > # The 'sender' of the claim > belongs_to :claimant, :class_name => "User" > # The 'reviewer' of the claim > belongs_to :reviewer, :class_name => "User" > # The 'owner' of a successful claim > belongs_to :owner, :class_name => "User" > lifecycle do > state :in_review, :active, :unclaimed, :contested > > create :claim, :params => [ :business, :acknowledge ], :become > => :in_review, > :available_to => "User", > :user_becomes => :claimant > > transition :accept, { :in_review => :active }, > :available_to => "User", > :user_becomes => :reviewer, > :claimant_becomes => :owner > > transition :reject, { :in_review => :unclaimed }, > :available_to => "User", > :user_becomes => :reviewer > > transition :contest, { :active => :contested }, > :available_to => "User", > :user_becomes => :claimant > end > > _______________________________________________________ > CONTROLLER: > class BusinessOwnershipsController < ApplicationController > > hobo_model_controller > > auto_actions :all #:lifecycle > > end > > ________________________________________________________ > VIEW: > Standard auto generated view --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
