handling checkbox attribute

21 views
Skip to first unread message

MilesTogoe

unread,
Nov 18, 2009, 3:30:21 PM11/18/09
to datam...@googlegroups.com
there seems to be a problem with saving or updating a checkbox value.  is there a workaround ? 

Tony Mann

unread,
Nov 18, 2009, 6:33:40 PM11/18/09
to datam...@googlegroups.com
If a checkbox is not checked, it will not appear in the params list at all. So you need to explicitly check for it in your controller code.

..tony..

On Wed, Nov 18, 2009 at 12:30 PM, MilesTogoe <miles...@gmail.com> wrote:
there seems to be a problem with saving or updating a checkbox value.  is there a workaround ? 

--

You received this message because you are subscribed to the Google Groups "DataMapper" group.
To post to this group, send email to datam...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.

MarkMT

unread,
Nov 18, 2009, 8:01:44 PM11/18/09
to DataMapper
Also be aware of this issue with checkboxes and multipart input in
merb edge -

http://groups.google.com/group/merb/browse_thread/thread/f7465e08437e8bac/da419a256046aac0?#da419a256046aac0

A patch was submitted today that it's hoped will address this.

Mark.

MilesTogoe

unread,
Nov 18, 2009, 9:59:13 PM11/18/09
to datam...@googlegroups.com
On 11/18/2009 06:01 PM, MarkMT wrote:
> Also be aware of this issue with checkboxes and multipart input in
> merb edge -
>
> http://groups.google.com/group/merb/browse_thread/thread/f7465e08437e8bac/da419a256046aac0?#da419a256046aac0
>
> A patch was submitted today that it's hoped will address this.
>

so I guess it's an erb thing? We're running Sinatra so wonder where
that leads us ? will there need to be a separate patch for Sinatra ?
I figured since it's between html and the model, it should be handled in
DM but could be wrong - do I need to post this in the Sinatra list ?


> Mark.
>
>
>
> Tony Mann wrote:
>
>> If a checkbox is not checked, it will not appear in the params list at all.
>> So you need to explicitly check for it in your controller code.
>>
>> ..tony..
>>
>> On Wed, Nov 18, 2009 at 12:30 PM, MilesTogoe<miles...@gmail.com> wrote:
>>
>>
>>> there seems to be a problem with saving or updating a checkbox value. is
>>> there a workaround ?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "DataMapper" group.
>>> To post to this group, send email to datam...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/datamapper?hl=en.
>>>
>>>
> --
>
> You received this message because you are subscribed to the Google Groups "DataMapper" group.
> To post to this group, send email to datam...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/datamapper?hl=.
>
>
>
>

MarkMT

unread,
Nov 18, 2009, 10:24:48 PM11/18/09
to DataMapper
MilesTogoe wrote:
> so I guess it's an erb thing? We're running Sinatra so wonder where
> that leads us ? will there need to be a separate patch for Sinatra ?
> I figured since it's between html and the model, it should be handled in
> DM but could be wrong - do I need to post this in the Sinatra list ?

I believe the issue is with merb's multipart input parsing. I'm not
too familiar with Sinatra, but I wouldn't think this would affect that.
Reply all
Reply to author
Forward
0 new messages