Here is a quick-fix. Put the following code in application.dryml:

<def tag="input" for="integer" attrs="name">
        <%attributes[:maxlength]=10%>
  <%= text_field_tag(name, this, attributes) %>
</def>

This will not crash the app when the user puts the input in the form
due to the maxlength attribute.

Regards,
  TF

On Jan 15, 3:08 pm, Tiago Franco <[email protected]> wrote:
> Yep :)
>
> I'm trying to handle integers. In the nominal scenario a user enters
> an integer and everything goes well. But by default, the integer
> editor allows a user to enter a bignum. If that happens the app will
> crash.
>
> Regards,
>   TF
>
> On Jan 13, 10:47 pm, kevinpfromnm <[email protected]> wrote:
>
> > Ahh.. so you're not trying to be able to handle big nums, just the
> > integer field can become a bignum without the backend being able to
> > handle it appropriately.
>
> > On Jan 13, 2:59 am, Tiago Franco <[email protected]> wrote:
>
> > > Hi Kevin,
>
> > > Thanks for the quick reply.
>
> > > I'm sorry, I didn't explain myself correctly.
>
> > > I'm not trying to do anything fancy. See my model below:
>
> > > fields do
> > >     ...
> > >     maximum_memberships :integer, :null => false
> > >    ...
> > >   end
>
> > >   validates_presence_of :maximum_memberships
> > >   validates_numericality_of :maximum_memberships, :only_integer =>
> > > true, :greater_than_or_equal_to => 2, :less_than_or_equal_to => 30
>
> > > Two comments on the integer editor field:
>
> > > 1 - The editor is too big (i.e. induces the user to type  of large
> > > numbers)
> > > 2 - It crashes when the user types, for example, 123456789123456789
>
> > > Regards,
> > >   TF
>
> > > On Jan 13, 1:57 am, kevinpfromnm <[email protected]> wrote:
>
> > > > Have you tried defining an input tag for bignum that just calls the
> > > > integer tag?
>
> > > > On Jan 12, 5:40 pm, Tiago Franco <[email protected]> wrote:
>
> > > > > If the user enters a very big number in a numeric box, the rapid fails
> > > > > to process the input.
>
> > > > > See:
>
> > > > >http://hobo.lighthouseapp.com/projects/8324-hobo/tickets/368-rapid-cr...
>
> > > > > A quick solution for now is to limit the size of the input box.
>
> > > > > TF
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to