Fnargh::Form::Auto (Soon to be HTML::FormHandler::Reflector::DBIC)

user-pic

Wiki Extras for this post

I've never really liked dealing with creating forms. You have to write a butt load of tedious HTML, validate it, and then return error messages as needed. If you want it to be fancy and pretty, you have to write a bunch of CSS to put your error messages where you want and make them shiny. Luckily, there are things to handle this.

Being a Moose fanatic, I am most partial to the latter, HTML::FormHandler. It's extremely easy to use, and requires zero configuration file crap. You get validation as Moose types/constraints, it's very cool.

So, back to me hating having to build forms. This includes building a form for something that already has enough information to build a form from, say, a database schema. My dream has been to be able to read a database schema (preferably DBIx::Class), and generate a form based on the data types specified in said schema. This is completely doable! Heck, even I drafted up some code to get some preliminary form fields from a database. The following is from the CMS I'm working on, using HTML::FormHandler and DBIx::Class to get things done. This is extremely proof of concept code, and doesn't actually have any logic to determine what kind of form element a given schema entity should be. That, however, should be fairly trivial and I will undoubtedly be writing a follow up to that effect. Go here to check out the source: http://gist.github.com/230652. Enjoy.

No TrackBacks

TrackBack URL: http://www.catalyzed.org/mt/mt-tb.fcgi/73

5 Comments

| Leave a comment

I'm excited about this, please keep us posted!

Your HTML::FormHandler link is broken, just FYI.

I've also been playing around with HTML::FormBuilder and like it alot. For simple forms it might be a bit of an overkill and much quicker just using a quick template, but for more complicated stuff like dynamic forms requiring various validations etc. it provides an excellent tool.

men great post, I'm new working with catalyst that's why I need your help.. I need to execute a bash script from a controller, when I call that path EXAMPLE localhost:3000/execute/bash freeze the all aplication, don't show anything don't do nothing

this is my code..

execute.pm

### LA SUBRUTINA ABAJO

sub bash: Local {
my ( $Self,$c) = @_ ;
exec ("/home/house/bash.sh") ;
$c->response->body('DOING SOMETHING');

}


The bash script is nothing only doing a GET for a web page

bash.sh

#!/bin/bash

GET http://www.taringa.net > taringa.txt

that's it, my problem is how I execute a bash from the catalyst calling from a URL.. Excuse my english. Thanks for the help.


Leave a comment

All comments are moderated. Spammers don't waste your time

Sponsored By


Ionzero: Rescue your dev project.
OpenID accepted here Learn more about OpenID

Following

Not following anyone

Note to spammers: all comments are moderated. Don't waste your time