FAQ
Hello all,

I'm currently using FormBuilder to generate some forms to be used in my
Catalyst Application. However FormBuilder wants to have the same method
handle the submit as well as the display. For certain reasons this isn't
what I want. So I'm trying to set the action of the form to the correct
path. However FormBuilder only wants to take a path that is rooted for
it's action argument, for example:

$form = $self->formbuilder();
# Works:
$form->action('/path/to/method');

# Doesn't work:
$form->action('path/to/method');
# Still doesn't work:
$form->action("http://example.com/path/to/method");

What I really want to be able to use is something like:

$c->uri_for($self->action_for('method_name'), ...);

However this returns a url complete with the HTTP. Is it possible to get
something similar that provides just the path (/path/to/method)? The
reason I want to do it this way is that I have some methods that are
submitting to URLS that contain captures.

--
o) Derek Wueppelmann (o
(D . dwueppel@gmail.com D).
((` http://www.monkeynet.ca ( ) `

Search Discussions

  • Jay Shirley at Dec 15, 2009 at 7:13 pm

    On Tue, Dec 15, 2009 at 10:51 AM, Derek Wueppelmann wrote:

    Hello all,

    I'm currently using FormBuilder to generate some forms to be used in my
    Catalyst Application. However FormBuilder wants to have the same method
    handle the submit as well as the display. For certain reasons this isn't
    what I want. So I'm trying to set the action of the form to the correct
    path. However FormBuilder only wants to take a path that is rooted for
    it's action argument, for example:

    $form = $self->formbuilder();
    # Works:
    $form->action('/path/to/method');

    # Doesn't work:
    $form->action('path/to/method');
    # Still doesn't work:
    $form->action("http://example.com/path/to/method");

    What I really want to be able to use is something like:

    $c->uri_for($self->action_for('method_name'), ...);

    However this returns a url complete with the HTTP. Is it possible to get
    something similar that provides just the path (/path/to/method)? The
    reason I want to do it this way is that I have some methods that are
    submitting to URLS that contain captures.
    $c->uri_for returns a URI object. If you look at the pod there, you'll see
    the ->path method which returns exactly what you want.

    -J
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091215/1c0cbaca/attachment.htm
  • Derek Wueppelmann at Dec 15, 2009 at 8:18 pm

    On Tue, 2009-12-15 at 11:13 -0800, J. Shirley wrote:

    $c->uri_for returns a URI object. If you look at the pod there,
    you'll see the ->path method which returns exactly what you want.
    That's just what I was looking for. Thanks.

    --
    o) Derek Wueppelmann (o
    (D . dwueppel@gmail.com D).
    ((` http://www.monkeynet.ca ( ) `

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 15, '09 at 6:51p
activeDec 15, '09 at 8:18p
posts3
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Derek Wueppelmann: 2 posts Jay Shirley: 1 post

People

Translate

site design / logo © 2022 Grokbase