Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Basic CRUD Tutorial

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


avsmith at gmail

May 6, 2008, 5:16 AM

Post #1 of 5 (306 views)
Permalink
Basic CRUD Tutorial

I'm new to Catalyst, and am working my way through the tutorial. I'm
on the "BasicCRUD" section, and something is not behaving as it
should. I've gotten to the end of the "FORMLESS SUBMISSION" section,
and entering the URL
< http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>
works as advertised, entering an appropriate record into the database.

However, the link for "Return to list" (coming from the
'create_done.tt2' template) points to itself
(<http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>)
rather than (<http://localhost:3000/books/list>).

The 'create_done.tt2' template includes:

<a href="[% Catalyst.uri_for('/books/list') %]">Return to list</a></p>

However, this function doesn't seem to be building the appropriate
URI. I'm on Mac OS X 10.5.2, and built Catalyst yesterday from CPAN
using the system Perl.

I can't rule out that I did something silly, but I went through this
twice, and twice got the same issue.

Does anyone know what might be the issue.

Thanks,
-albert

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


diment at gmail

May 6, 2008, 5:25 AM

Post #2 of 5 (291 views)
Permalink
Re: Basic CRUD Tutorial [In reply to]

On 6 May 2008, at 22:16, Albert Vernon Smith wrote:

> I'm new to Catalyst, and am working my way through the tutorial. I'm
> on the "BasicCRUD" section, and something is not behaving as it
> should. I've gotten to the end of the "FORMLESS SUBMISSION" section,
> and entering the URL
> < http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>
> works as advertised, entering an appropriate record into the database.
>
> However, the link for "Return to list" (coming from the
> 'create_done.tt2' template) points to itself
> (<http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>)
> rather than (<http://localhost:3000/books/list>).
>
> The 'create_done.tt2' template includes:
>
> <a href="[% Catalyst.uri_for('/books/list') %]">Return to list</a></p>
>
> However, this function doesn't seem to be building the appropriate
> URI. I'm on Mac OS X 10.5.2, and built Catalyst yesterday from CPAN
> using the system Perl.
>
> I can't rule out that I did something silly, but I went through this
> twice, and twice got the same issue.
>

Please checkout the reference implementation for the tutorial from:

svn checkout http://dev.catalyst.perl.org/repos/Catalyst/tags/
examples/Tutorial/MyApp/5.7/

If the problem still exists then there's a problem with the code, or
your catalyst install. Please let us know if the reference
implementation is also doing the wrong thing.

Thanks

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


avsmith at gmail

May 6, 2008, 6:09 AM

Post #3 of 5 (292 views)
Permalink
Re: Basic CRUD Tutorial [In reply to]

The reference implementation works as it should. There are not "diff"
changes between my implementation and the tutorial for both
"lib/MyApp/Controller/Books.pm", "root/src/books/create_done.tt2".

-albert



On Tue, May 6, 2008 at 12:25 PM, Kieren Diment <diment[at]gmail.com> wrote:
>
>
> On 6 May 2008, at 22:16, Albert Vernon Smith wrote:
>
>
> > I'm new to Catalyst, and am working my way through the tutorial. I'm
> > on the "BasicCRUD" section, and something is not behaving as it
> > should. I've gotten to the end of the "FORMLESS SUBMISSION" section,
> > and entering the URL
> > < http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>
> > works as advertised, entering an appropriate record into the database.
> >
> > However, the link for "Return to list" (coming from the
> > 'create_done.tt2' template) points to itself
> > (<http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>)
> > rather than (<http://localhost:3000/books/list>).
> >
> > The 'create_done.tt2' template includes:
> >
> > <a href="[% Catalyst.uri_for('/books/list') %]">Return to list</a></p>
> >
> > However, this function doesn't seem to be building the appropriate
> > URI. I'm on Mac OS X 10.5.2, and built Catalyst yesterday from CPAN
> > using the system Perl.
> >
> > I can't rule out that I did something silly, but I went through this
> > twice, and twice got the same issue.
> >
> >
>
> Please checkout the reference implementation for the tutorial from:
>
> svn checkout
> http://dev.catalyst.perl.org/repos/Catalyst/tags/examples/Tutorial/MyApp/5.7/
>
> If the problem still exists then there's a problem with the code, or your
> catalyst install. Please let us know if the reference implementation is
> also doing the wrong thing.
>
> Thanks
>
> _______________________________________________
> List: Catalyst[at]lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


avsmith at gmail

May 6, 2008, 7:31 AM

Post #4 of 5 (287 views)
Permalink
Re: Basic CRUD Tutorial [In reply to]

I have figured out the issue.

Since the reference installation worked, I obviously had no grander
software problem. I then replaced files one-by-one to find the issue.
By doing that, I could see that the file "lib/MyApp/View/TT.pm" was
missing a config definition for

CATALYST_VAR

Looking at the output from:

script/myapp_create.pl view TT TTSite

I can see the line was not added into this file. So, if I add
CATALYST_VAR, I can fix the issue updating to:

__PACKAGE__->config({
CATALYST_VAR => 'Catalyst',
...

Now, being new around here, I'm not sure if the non-inclusion of
"CATALYST_VAR" in VIew/TT.pm from TTSite output is a "bug" or a
"feature". In any case, it does show an incosistecy between the
tutorial documentation and what is happening. I am working with
Catalyst 5.7012.

-albert


On Tue, May 6, 2008 at 1:09 PM, Albert Vernon Smith <avsmith[at]gmail.com> wrote:
> The reference implementation works as it should. There are not "diff"
> changes between my implementation and the tutorial for both
> "lib/MyApp/Controller/Books.pm", "root/src/books/create_done.tt2".
>
> -albert
>
>
>
>
>
> On Tue, May 6, 2008 at 12:25 PM, Kieren Diment <diment[at]gmail.com> wrote:
> >
> >
> > On 6 May 2008, at 22:16, Albert Vernon Smith wrote:
> >
> >
> > > I'm new to Catalyst, and am working my way through the tutorial. I'm
> > > on the "BasicCRUD" section, and something is not behaving as it
> > > should. I've gotten to the end of the "FORMLESS SUBMISSION" section,
> > > and entering the URL
> > > < http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>
> > > works as advertised, entering an appropriate record into the database.
> > >
> > > However, the link for "Return to list" (coming from the
> > > 'create_done.tt2' template) points to itself
> > > (<http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>)
> > > rather than (<http://localhost:3000/books/list>).
> > >
> > > The 'create_done.tt2' template includes:
> > >
> > > <a href="[% Catalyst.uri_for('/books/list') %]">Return to list</a></p>
> > >
> > > However, this function doesn't seem to be building the appropriate
> > > URI. I'm on Mac OS X 10.5.2, and built Catalyst yesterday from CPAN
> > > using the system Perl.
> > >
> > > I can't rule out that I did something silly, but I went through this
> > > twice, and twice got the same issue.
> > >
> > >
> >
> > Please checkout the reference implementation for the tutorial from:
> >
> > svn checkout
> > http://dev.catalyst.perl.org/repos/Catalyst/tags/examples/Tutorial/MyApp/5.7/
> >
> > If the problem still exists then there's a problem with the code, or your
> > catalyst install. Please let us know if the reference implementation is
> > also doing the wrong thing.
> >
> > Thanks
> >
> > _______________________________________________
> > List: Catalyst[at]lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
> >
>

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


jshirley at gmail

May 6, 2008, 8:01 AM

Post #5 of 5 (287 views)
Permalink
Re: Basic CRUD Tutorial [In reply to]

On Tue, May 6, 2008 at 7:31 AM, Albert Vernon Smith <avsmith[at]gmail.com> wrote:
> I have figured out the issue.
>
> Since the reference installation worked, I obviously had no grander
> software problem. I then replaced files one-by-one to find the issue.
> By doing that, I could see that the file "lib/MyApp/View/TT.pm" was
> missing a config definition for
>
> CATALYST_VAR
>
> Looking at the output from:
>
> script/myapp_create.pl view TT TTSite
>
> I can see the line was not added into this file. So, if I add
> CATALYST_VAR, I can fix the issue updating to:
>
> __PACKAGE__->config({
> CATALYST_VAR => 'Catalyst',
> ...
>
> Now, being new around here, I'm not sure if the non-inclusion of
> "CATALYST_VAR" in VIew/TT.pm from TTSite output is a "bug" or a
> "feature". In any case, it does show an incosistecy between the
> tutorial documentation and what is happening. I am working with
> Catalyst 5.7012.
>
> -albert
>
>
>
>
> On Tue, May 6, 2008 at 1:09 PM, Albert Vernon Smith <avsmith[at]gmail.com> wrote:
> > The reference implementation works as it should. There are not "diff"
> > changes between my implementation and the tutorial for both
> > "lib/MyApp/Controller/Books.pm", "root/src/books/create_done.tt2".
> >
> > -albert
> >
> >
> >
> >
> >
> > On Tue, May 6, 2008 at 12:25 PM, Kieren Diment <diment[at]gmail.com> wrote:
> > >
> > >
> > > On 6 May 2008, at 22:16, Albert Vernon Smith wrote:
> > >
> > >
> > > > I'm new to Catalyst, and am working my way through the tutorial. I'm
> > > > on the "BasicCRUD" section, and something is not behaving as it
> > > > should. I've gotten to the end of the "FORMLESS SUBMISSION" section,
> > > > and entering the URL
> > > > < http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>
> > > > works as advertised, entering an appropriate record into the database.
> > > >
> > > > However, the link for "Return to list" (coming from the
> > > > 'create_done.tt2' template) points to itself
> > > > (<http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4>)
> > > > rather than (<http://localhost:3000/books/list>).
> > > >
> > > > The 'create_done.tt2' template includes:
> > > >
> > > > <a href="[% Catalyst.uri_for('/books/list') %]">Return to list</a></p>
> > > >
> > > > However, this function doesn't seem to be building the appropriate
> > > > URI. I'm on Mac OS X 10.5.2, and built Catalyst yesterday from CPAN
> > > > using the system Perl.
> > > >
> > > > I can't rule out that I did something silly, but I went through this
> > > > twice, and twice got the same issue.
> > > >
> > > >
> > >
> > > Please checkout the reference implementation for the tutorial from:
> > >
> > > svn checkout
> > > http://dev.catalyst.perl.org/repos/Catalyst/tags/examples/Tutorial/MyApp/5.7/
> > >
> > > If the problem still exists then there's a problem with the code, or your
> > > catalyst install. Please let us know if the reference implementation is
> > > also doing the wrong thing.
> > >
> > > Thanks

I'm not too familiar with the tutorial, or TTSite, but the standard
Catalyst var entry is simply "c" for just Catalyst::View::TT on its
own. Some other folks use "ctx", but I think "c" is the standard
default.

You can set it to any value that you like, but it is something to be
mindful of if you bounce between other apps, or apps that others have
written (like the plethora of examples in svn).

-J

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.