Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Default input type

Received: by 10.224.201.197 with SMTP id fb5mr2686133qab.7.1330608979456;
        Thu, 01 Mar 2012 05:36:19 -0800 (PST)
X-BeenThere: plataformatec-simpleform@googlegroups.com
Received: by 10.224.53.12 with SMTP id k12ls3218457qag.5.gmail; Thu, 01 Mar
 2012 05:36:18 -0800 (PST)
Received: by 10.236.103.68 with SMTP id e44mr5269433yhg.3.1330608978073;
        Thu, 01 Mar 2012 05:36:18 -0800 (PST)
Received: by 10.236.103.68 with SMTP id e44mr5269432yhg.3.1330608978059;
        Thu, 01 Mar 2012 05:36:18 -0800 (PST)
Return-Path: <rafaelmfra...@gmail.com>
Received: from mail-yw0-f43.google.com (mail-yw0-f43.google.com [209.85.213.43])
        by gmr-mx.google.com with ESMTPS id d20si1125802yhj.1.2012.03.01.05.36.18
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 01 Mar 2012 05:36:18 -0800 (PST)
Received-SPF: pass (google.com: domain of rafaelmfra...@gmail.com designates 209.85.213.43 as permitted sender) client-ip=209.85.213.43;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of rafaelmfra...@gmail.com designates 209.85.213.43 as permitted sender) smtp.mail=rafaelmfra...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-yw0-f43.google.com with SMTP id k6so249591yhk.16
        for <plataformatec-simpleform@googlegroups.com>; Thu, 01 Mar 2012 05:36:18 -0800 (PST)
Received-SPF: pass (google.com: domain of rafaelmfra...@gmail.com designates 10.236.145.193 as permitted sender) client-ip=10.236.145.193;
Received: from mr.google.com ([10.236.145.193])
        by 10.236.145.193 with SMTP id p41mr6731008yhj.124.1330608978022 (num_hops = 1);
        Thu, 01 Mar 2012 05:36:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=date:from:to:message-id:in-reply-to:references:subject:x-mailer
         :mime-version:content-type;
        bh=JQFbawUbG5hSO2csEIppSPjX4kyPXWFqUkOibwicFCc=;
        b=Rgz4GjCnFeS88cdzftbc7RNIRrbA9i0Khh/8eo38bSOSZap5E6HDgIOulUKOfh+Gkg
         H1xnFcfEPRAuczyPVwNjcahirsvLLyRtiXUttl8Oo8+QpZH6XVndhrbN9DgtGLJF5P69
         xohVWgo6zItoxB7j7xGgHUs/MhWBEKpQ3eHgU=
Received: by 10.236.145.193 with SMTP id p41mr5234653yhj.124.1330608977968;
        Thu, 01 Mar 2012 05:36:17 -0800 (PST)
Return-Path: <rafaelmfra...@gmail.com>
Received: from ayreon.local (c9349f90.virtua.com.br. [201.52.159.144])
        by mx.google.com with ESMTPS id o41sm5034379yhj.7.2012.03.01.05.36.16
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 01 Mar 2012 05:36:16 -0800 (PST)
Date: Thu, 1 Mar 2012 10:36:14 -0300
From: =?utf-8?Q?Rafael_Mendon=C3=A7a_Fran=C3=A7a?=
 <rafaelmfra...@gmail.com>
To: plataformatec-simpleform@googlegroups.com
Message-ID: <6F62C84E1FA44E02B3E873913E158...@gmail.com>
In-Reply-To: <CABqc0WBdKsC_i7Mcmqn_aA7JRaOpsOSxMcZmuWQ2LZ0h6Rr...@mail.gmail.com>
References: <28326634.852.1330587947909.JavaMail.geo-discussion-forums@ynkz21>
 <ABA77BE2710341D885699F824EF1E...@gmail.com>
 <CABqc0WBdKsC_i7Mcmqn_aA7JRaOpsOSxMcZmuWQ2LZ0h6Rr...@mail.gmail.com>
Subject: Re: Default input type
X-Mailer: sparrow 1.5 (build 1043.1)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="4f4f7b4e_46111ba5_45b7"

--4f4f7b4e_46111ba5_45b7
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

You can try to patch the input method. As you are in the =46ormBuilder yo=
u have access to the =40object and you can change the options hash. But y=
ou need also to patch the default=5Finput=5Ftype. =20

Do you have suggestions to improve this API=3F =20

-- =20
Rafael Mendon=C3=A7a =46ran=C3=A7a
http://twitter.com/rafaelfranca
https://github.com/rafaelfranca
Sent with Sparrow (http://www.sparrowmailapp.com)


On Thursday, 1 March, 2012 at 09:09, Sergey Nartimov wrote:

> Thanks for reply.
> =20
> We're writing S=46 integration to provide select field for string colum=
n
> based on model metadata. So we don't want default input type to be
> global for all models. That is why =60input=5Fmappings=60 can't be used=
 in
> our case. It's better if we can patch some method where model is
> accessible and where default options can be set (in our case we need
> to add =60collection=60 option). Are there any other variants besides
> patching =60default=5Finput=5Ftype=60 method=3F
> =20
> On Thu, Mar 1, 2012 at 2:57 PM, Rafael Mendon=C3=A7a =46ran=C3=A7a
> <rafaelmfranca=40gmail.com (mailto:rafaelmfranca=40gmail.com)> wrote:
> > Hey Sergey=21
> > =20
> > You can use the input=5Fmappings configuration options.
> > =20
> > Basically it is a colummn name =3D> type mapping.
> > =20
> > You can do things like:
> > =20
> > config.input=5Fmappings =3D =7B /=5Fprice/ =3D> :decimal =7D
> > =20
> > --
> > Rafael Mendon=C3=A7a =46ran=C3=A7a
> > http://twitter.com/rafaelfranca
> > https://github.com/rafaelfranca
> > Sent with Sparrow
> > =20
> > On Thursday, 1 March, 2012 at 04:45, Sergey Nartimov wrote:
> > =20
> > =D0=A1ould you suggest a way to set default input type based on model=
 metadata in
> > S=46=3F
> > =20
> > There is method that can be monkey-patched
> > https://github.com/plataformatec/simple=5Fform/blob/master/lib/simple=
=5Fform/form=5Fbuilder.rb=23L376-402
> > but it isn't public API.
> > =20
> > Thanks. =20


--4f4f7b4e_46111ba5_45b7
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline


                <div>
                    You can try to patch the input method. As you are in =
the =46ormBuilder you have access to the =40object and you can change the=
 options hash. But you need also to patch the default=5Finput=5Ftype.
                </div><div><br></div><div>Do you have suggestions to impr=
ove this API=3F</div>
                <div><div><br></div>--&nbsp;<br><b>Rafael Mendon=C3=A7a =46=
ran=C3=A7a</b><div><div><span style=3D=22font-family: arial; font-size: 1=
2px; =22><a href=3D=22http://twitter.com/rafaelfranca=22 target=3D=22=5Fb=
lank=22>http://twitter.com/rafaelfranca</a><br><a href=3D=22https://githu=
b.com/rafaelfranca=22 target=3D=22=5Fblank=22>https://github.com/rafaelfr=
anca</a></span><br><span style=3D=22font-size: 11px; =22>Sent with </span=
><a href=3D=22http://www.sparrowmailapp.com=22 style=3D=22font-size: 11px=
; =22>Sparrow</a><br></div></div><div><br></div></div>
                =20
                <p style=3D=22color: =23A0A0A8;=22>On Thursday, 1 March, =
2012 at 09:09, Sergey Nartimov wrote:</p>
                <blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
                    <span><div><div><div>Thanks for reply.</div><div><br>=
</div><div>We're writing S=46 integration to provide select field for str=
ing column</div><div>based on model metadata. So we don't want default in=
put type to be</div><div>global for all models. That is why =60input=5Fma=
ppings=60 can't be used in</div><div>our case. It's better if we can patc=
h some method where model is</div><div>accessible and where default optio=
ns can be set (in our case we need</div><div>to add =60collection=60 opti=
on). Are there any other variants besides</div><div>patching =60default=5F=
input=5Ftype=60 method=3F</div><div><br></div><div>On Thu, Mar 1, 2012 at=
 2:57 PM, Rafael Mendon=C3=A7a =46ran=C3=A7a</div><div>&lt;<a href=3D=22m=
ailto:rafaelmfranca=40gmail.com=22>rafaelmfranca=40gmail.com</a>&gt; wrot=
e:</div><blockquote type=3D=22cite=22><div><div>Hey Sergey=21</div><div><=
br></div><div>You can use the input=5Fmappings configuration options.</di=
v><div><br></div><div>Basically it is a colummn name =3D&gt; type mapping=
.</div><div><br></div><div>You can do things like:</div><div><br></div><d=
iv>config.input=5Fmappings =3D =7B /=5Fprice/ =3D&gt; :decimal =7D</div><=
div><br></div><div>--</div><div>Rafael Mendon=C3=A7a =46ran=C3=A7a</div><=
div><a href=3D=22http://twitter.com/rafaelfranca=22>http://twitter.com/ra=
faelfranca</a></div><div><a href=3D=22https://github.com/rafaelfranca=22>=
https://github.com/rafaelfranca</a></div><div>Sent with Sparrow</div><div=
><br></div><div>On Thursday, 1 March, 2012 at 04:45, Sergey Nartimov wrot=
e:</div><div><br></div><div>=D0=A1ould you suggest a way to set default i=
nput type based on model metadata in</div><div>S=46=3F</div><div><br></di=
v><div>There is method that can be monkey-patched</div><div><a href=3D=22=
https://github.com/plataformatec/simple=5Fform/blob/master/lib/simple=5Ff=
orm/form=5Fbuilder.rb=23L376-402=22>https://github.com/plataformatec/simp=
le=5Fform/blob/master/lib/simple=5Fform/form=5Fbuilder.rb=23L376-402</a><=
/div><div>but it isn't public API.</div><div><br></div><div>Thanks.</div>=
</div></blockquote></div></div></span>
                =20
                =20
                =20
                =20
                </blockquote>
                =20
                <div>
                    <br>
                </div>
            
--4f4f7b4e_46111ba5_45b7--