Code Monkey home page Code Monkey logo

Comments (6)

fmluizao avatar fmluizao commented on August 28, 2024

If you look at the implementation of number_field, you will see the following:

  def to_number_field_tag(field_type, options = {})
    options = options.stringify_keys
    options['size'] ||= nil

    if range = options.delete("in") || options.delete("within")
      options.update("min" => range.min, "max" => range.max)
    end
    to_input_field_tag(field_type, options)
  end

https://github.com/rails/rails/blob/v3.2.9/actionpack/lib/action_view/helpers/form_helper.rb#L1049

In other words, if you use number_field, you need to pass in or within
as options.

On Wed, Jan 2, 2013 at 3:41 PM, mxtopher [email protected] wrote:

If I use delocalize, all my number_fields must explicitly set the value:

= f.number_field :foo, value: 2

If I omit it, as in

= f.number_field :foo

I get

"can't convert Symbol into Integer"


Reply to this email directly or view it on GitHubhttps://github.com//issues/53.

from delocalize.

clemens avatar clemens commented on August 28, 2024

Sorry for getting to this so late.

@fernandoluizao: Not sure you're right here. Neither parameter is required because if it's blank it will just skip the if construct.

@mxtopher: Could you please provide a failing test? I'm happy to investigate and fix it if you can't/won't do it but a failing test would be great. :)

from delocalize.

mxtopher avatar mxtopher commented on August 28, 2024

I'll provide it tonight/tomorrow. ;)

from delocalize.

mxtopher avatar mxtopher commented on August 28, 2024

... I am in working time. Besides, I'll have to learn how to create tests
(Which is a good thing, thank you [= )

from delocalize.

clemens avatar clemens commented on August 28, 2024

Sure, take your time. :) I probably won't get to it before the weekend anyway.

from delocalize.

clemens avatar clemens commented on August 28, 2024

1.0.0 is out which doesn't patch ActionView any longer. You can manually override the output as you see fit.

from delocalize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.