Sign up is not special.  It's just a standard transition action.  See the
life cycle manual for more details
On Feb 16, 2013 10:32 PM, "Peter Pavlovich" <[email protected]> wrote:

> Should that be "do_hobo_signup" or is "do_signup" the way to override the
> default behavior?
>
> Thanks,
>
> Peter
>
> On Saturday, February 16, 2013 10:19:32 PM UTC-5, Bryan Larsen wrote:
>>
>> hobo_login is the GET action for the signup page.  Tony probably wants
>> to update the PUT action:
>>
>> def do_signup
>>   do_creator_action :signup do
>>      if valid?
>>         redirect_to wherever
>>      end
>>   end
>> end
>>
>> Bryan
>>
>> On Sat, Feb 16, 2013 at 9:36 PM, Peter Pavlovich <[email protected]>
>> wrote:
>> > I think that "redirect_to" is only available in the controller. You may
>> have
>> > to override the hobo_signup(&b) method in the UsersController class.
>> >
>> > Here is the default implementation of this method:
>> >
>> >     def hobo_signup(&b)
>> >       if logged_in?
>> >         redirect_back_or_default(home_**page)
>> >       else
>> >         creator_page_action(:signup, &b)
>> >       end
>> >     end
>> >
>> > You would probably want to add this method to the UsersController
>> class:
>> >
>> >     def hobo_signup(&b)
>> >       if logged_in?
>> >         redirect_back_or_default(home_**page)
>> >       else
>> >         creator_page_action(:signup, &b)
>> >         redirect_to "/events/new"
>> >       end
>> >     end
>> >
>> > That seems like it might work for you. Perhaps Bryan or another group
>> reader
>> > will have a better suggestion for your scenario though.
>> >
>> > Regards,
>> >
>> > Peter
>> >
>> > On Saturday, February 16, 2013 6:07:42 PM UTC-5, tonym wrote:
>> >>
>> >> Hi All,
>> >>
>> >> maybe I'm doing something wrong here, but....
>> >>
>> >> I'm just trying to redirect to a certain page, after a user as signed
>> up.
>> >>
>> >> I've tried adding redirect_to...
>> >>
>> >>     create :signup, :available_to => "Guest",
>> >>       :become => :active  do
>> >>         redirect_to "/events/new"
>> >>     end
>> >>
>> >> This fails with: undefined method `redirect_to' for #<User:0x9b9c680>
>> >>
>> >> Same also occurs if I try 'redirect_to' in an after_create
>> >>
>> >> I've also tried adding 'after-submit' in the form and that does not
>> seem
>> >> to register, although it is clearly in the submission.
>> >>
>> >> Any ideas?
>> >>
>> >> Cheers, Anthony.
>> >
>> > --
>> > 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 hobousers+...@**googlegroups.com.
>> > To post to this group, send email to [email protected].
>> > Visit this group at 
>> > http://groups.google.com/**group/hobousers?hl=en<http://groups.google.com/group/hobousers?hl=en>.
>>
>> > For more options, visit 
>> > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>.
>>
>> >
>> >
>>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to