or-cancel return to index.

36 views
Skip to first unread message

paulj...@gmail.com

unread,
Jul 21, 2012, 1:49:57 PM7/21/12
to hobo...@googlegroups.com
I would like the cancel button in a new-for-user form to take the user to the root of my front-site.

I see examples for passing an object or collection to or-cancel, but I don't see a way to specify a page.

I have an inkling of defining a home-page method for users, but that is probably needlessly complicated.

Any ideas from the group?

Thanks so much!

Pd

Bryan Larsen

unread,
Jul 24, 2012, 5:34:41 PM7/24/12
to hobo...@googlegroups.com
or-cancel is simply a thin wrapper around `<a>`, so it has all of the
behaviour of a as well as the behaviour documented in the cookbook.
In your case, you can just use it in "dumb mode": <or-cancel
href="&root_path"/>

Bryan
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/77vdGVX13ZEJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

paulj...@gmail.com

unread,
Jul 25, 2012, 8:22:02 PM7/25/12
to hobo...@googlegroups.com
Thanks, Bryan! I will give it a try.
> hobousers+unsubscribe@googlegroups.com.

paulj...@gmail.com

unread,
Jul 31, 2012, 6:24:04 PM7/31/12
to hobo...@googlegroups.com
Thanks for your help with this. I have tried this and I can't get it to take effect.

My form is here: http://pastie.org/4367687

I have tried the following variations on &root_path:

  '/'
  '&root'
  '&root_path'

I have also tried several placements for the line, inside and outside the after-actions block.

Note that this is not an Ajax form - not sure if that makes a difference. I can post the whole page definition if that would be interesting.

In all cases, the Cancel button links to the Transaction Sets index page.

Thanks for any further help.

Bryan Larsen

unread,
Jul 31, 2012, 8:09:44 PM7/31/12
to hobo...@googlegroups.com
The problem isn't the href, it's the param name. If you look at
app/views/taglibs/auto/rapid/forms.dryml for your element, you'll see
<or-cancel param="cancel"/>.

So just use:

<cancel: href="&root_path"/>

Yes, the naming is inconsistent with convention, but far too many apps
depend on it staying the way it is.

Bryan
>>> > hobousers+...@googlegroups.com.
>>> > 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 view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/iCvLovFX7m4J.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.

paulj...@gmail.com

unread,
Sep 14, 2012, 6:15:41 PM9/14/12
to hobo...@googlegroups.com
Thanks so much for your help. I just got back to this and implemented it and it worked great.

Thanks so much, Bryan.
Reply all
Reply to author
Forward
0 new messages