On Fri, 13 Mar 2009 14:10:48 -0700 (PDT), "[email protected]" <[email protected]> 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. > 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. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
