_form generation

Hi group,

starting up with rails, coming from the perl world I was confused about
some of the concepts behind rails.
What I wonder most at the moment is the follwoing :

I created a rails project, creates the databases and a table looking
like so :

drop table if exists bla;
create table client(
id int not null auto_increment,
name varchar(40) not null,
flag boolean not null,
primary key(id)

… after that I creates my first scaffold and a controller named Admin

script/generate scaffold Client Admin.

I exspected a new/edit mask like that :

a textfield for the name
a checkbox for the bool flag

but I was disapointed, I found a select with the options true and
false. Since I’d like to create something like a licensing application
I need to create licenses where there need to be set 128 Boolean flags.
This could easily be done using checkboxes but becomes the horror using

So I dropped down the select fiel by hand and created a checkbox on my
own. It took hours(!!!) to get the right formatted list of arguments
till it worked. Meanwhile I was confused by :

ri checkbox

… did not find anything when issuing

ri check_box

And even after a ./gem_server redirecting my browser to localhost:8808
I did not find any sentence about checkboxes.

Ok, so far, I got it. But if I create my real world applicaion now I’d
need to set all 128 checkboxes by hand, and this is something I dont
understand. Booleans - in my opinion - are greatfully predestinated to
be mapped on checkboxes, why does’nt rails act that way?

Can I change rails behaviour or is there any other way to map a
checked/unchecked checkbox as true/false 1/0 in my table?

The second question I have is, is there any easier way to find
documentation for inbuild calls?

Jason Nerer
support[ at ]esiqia.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs