On Mar 13, 6:30 pm, <
ser...@entrecables.com> wrote:
> On Fri, 13 Mar 2009 14:10:48 -0700 (PDT), "
reube...@gmail.com"
>
> <
reube...@gmail.com> wrote:
> > I'm experiencing an odd situation with toggling bool values with
> > checkboxes in ActiveScaffold. The checkboxes seem to toggle back and
> > forth between TRUE and a null / unassigned value rather than between
> > TRUE and FALSE.
>
> Set :null => false in your migration.
>
>
>
> > I am using Postgresql and thought that might be the source of the
> > problem since postgresql seems to have 3 possible vales for bool:
> > TRUE, FALSE and Unassigned. Is there anyway to deal with this?
>
> Using a drop-down box, you should be able to choose true, false or nothing
> (NULL). If you want to use a checkbox and you want true or false values,
> set column to NOT NULL in database
Thanks.
>
> > Creating a record with an initial value of FALSE works correctly, but
> > after that, if I change it I only get TRUE and Unassigned.
>
> > On a somewhat related issue, how can I enable inline editing while at
> > the same time excluding the update action? I want to get rid of the
> > edit link and just have this bool value toggled via checkbox from the
> > list view. But disabling update, prevents the bool value from being
> > updated in the DB when toggling the checkbox.
>
> I'm not sure I have understood you. Do you want to have the checkbox in the
> list without the edit link to edit the model? Maybe you can change the
> security method for the edit link, edit won't be disabled (you can enter
> the url to edit), but you can disable update for all columns apart from the
> boolean column.
>
>
Yes, I just want to get rid of the edit link, but still do inline-
updates of the bool. The reason is that I don't want the user to be
able to change anything besides the bool value after the record is
created. The only other thing I can think of is if there are separate
forms for create and update. Is there any type of conditional
statement that can be called from within the helper override to
determine if it is being called for create or update?