Comments (6)
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.
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.
I'll provide it tonight/tomorrow. ;)
from delocalize.
... I am in working time. Besides, I'll have to learn how to create tests
(Which is a good thing, thank you [= )
from delocalize.
Sure, take your time. :) I probably won't get to it before the weekend anyway.
from delocalize.
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)
- Delocalize in Production HOT 2
- Delocalize does not work with Gem best_in_place HOT 3
- dirty attributes are not correctly set HOT 7
- License missing from gemspec HOT 2
- rails g fails - 0.3.1 HOT 1
- not working in rails/ruby 2 HOT 7
- thousand problem HOT 2
- Error delocalizing params with nested attributes HOT 3
- Parsing a localized date HOT 3
- Rails 4.2 compatibility HOT 13
- French Date issue. Probably Regexp fail? HOT 7
- Setting an invalid value in a time field while doing update_attributes! sets the value to nil HOT 3
- Rails 3.2.22.2 app fails to start: uninitialized constant Delocalize::DelocalizableParameters HOT 10
- Number parser failing with i18n fallbacks HOT 1
- Different structure of params in Rails 5 HOT 9
- Demo application not available HOT 5
- Are the rails_ext files needed?
- Regular expression for date time format does not escape regexp sensitive characters
- New controller-side paradigm not working for me HOT 10
- Regexp does not support many strptime formats HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delocalize.