> transition :block, { :inactive => :blocked }, :available_to
> => :all,
> :params => [:given_id]
params should map to attributes or columns on your model. Behind the
scenes Hobo will do something like user.given_id = params[:given_id].
In this case I don't think you need any params as the model is
already found to get to the transition
>
> to the users controller under admin
>
> def block(given_id)
>
> user = User.where(:id=>given_id)
> user.state = 'blocked'
> flash[:now] ="TEST"
> end
It's the do_block action you care about. Block is the action that
renders the block form. But Hobo should be creating a sufficient
block and do_block method for you, as long as you have auto_actions
:all or auto_actions :lifecycle in your controller. You do have one
of those, don't you?
You also aren't saving the user, so no changes are being persisted to
the database.
if you need to add code to your action you can do something like this:
def do_block
flash[:now] ="TEST"
do_transition_action :block
end
Bryan
--
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.