[Catalyst] Scaffolding: Catalyst v. Rails

Marcus Ramberg marcus at thefeed.no
Wed Nov 16 09:37:04 CET 2005


Hi Joshua.
You forgot you need an end action to forward to the view. the DefaultEnd
plugin can provide this four you if you add it to the use Catalyst line.

Marcus

On 11/16/05, Joshua Keroes <jkeroes at eli.net> wrote:
>
>
> I'm comparing scaffolding between Rails and Catalyst. My goal is to
> have a simple CRUD interface to a database of network devices. Bonus
> points if it looks slick (like Maypole's default view).
>
> Rails setup was easy:
> rails devices
> ruby script/generate scaffold Device
> vi config/database.yml
> ruby script/server
> http://localhost:3000/device/list
>
> And it looks boring but effective. It would be better if they
> supported mysql's enum().
>
>
> Catalyst setup:
> catalyst.pl Devices
> cd Devices
> script/devices_create.pl model Devices CDBI dbi:mysql:dbname=devdev
> devdev devdev
> script/devices_create.pl view TT TT
> script/devices_create.pl controller Devices Scaffold CDBI::Devices
>
> vi lib/Devices/Model/Devices.pm
> # add to config():
> additional_base_classes => [qw/Class::DBI::AsForm
> Class::DBI::FromForm/],
>
> vi lib/Devices.pm
> # change 'use Catalyst qw/-Debug Simple::Static/;'
> use Catalyst qw/-Debug Simple::Static FormValidator/;
>
> http://localhost:3000/devices/list
> http://localhost:3000/devices/
>
> ...and a blank page. No warnings, no complaints, but no HTML either.
>
>
> Questions:
>
> 1. Did I get the lib/Devices.pm base classes correct w.r.t. order?
>
> 2. How is capitalization w.r.t. devices_create.pl's arguments?
>
> 3. Is the model name supposed to be the same as the database table?
> (i.e. devices_create.pl model TableName ...) I've looked through much
> of the documentation but don't see where the table name is defined.
> I'd argue that this needs to be clearly documented in several places.
> grepping through the docs, this is glossed over when mentioned at
> all. Looks like undocumented magic to me.
>
> 4. What are the database conventions? (e.g. required columns,
> recommended columns, capitalization, type, and pluralization)
>
> Thanks,
> Joshua
>
> PS Need more info?
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



--
With regards
Marcus Ramberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051116/cad75123/attachment-0001.htm


More information about the Catalyst mailing list