Git Product home page Git Product logo

autonumeric-rails's People

Contributors

dy-dx avatar randoum avatar tiagoamaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autonumeric-rails's Issues

Only loads on page reload

I have autonumeric in a _form.html.erb as part of a simple new/edit view, but separator just displays on page reload.

this is how I'm displaying the input:

<%= f.label :buy, class: "col-xs-2 control-label" %>
<%= f.text_field :buy, value: (if @player.new_record? then "" else @player.buy.to_i end), data: {autonumeric: {mDec: 0}}, class: "form-control" %>

any advice???

Using autoNumeric('set', value) doesn't update hidden input

I create an input field like this:
= text_field_tag('test', 0, { data: {autonumeric: {aSign: '$ ', mDec: 0, wEmpty: 'sign', lZero: 'deny'}}})

I then update the value from javascript like this:
$("#test").autoNumeric('set', 4000)

The number changes to $ 4000 in the visible formatted input field as expected.
But the value of the hidden input does not change - so when the form is submitted the correct value does not get submitted.

"ERROR: directory is already being watched!"

I have two terminals, one is running "rails server", the other one "rails console". The second one, when starting the console, outputs this error message:

** ERROR: directory is already being watched! **
Directory: /my/path/.rvm/gems/ruby-2.3.1@project/gems/autonumeric-rails-1.9.46/spec/dummy/spec
is already being watched through: /my/path/.rvm/gems/ruby-2.3.1@project/gems/autonumeric-rails-1.9.46/spec
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors

Any ideas what would cause this?

Missing source-mapping when using autonumeric2

I get the following error after upgrading to autonumeric2

ActionController::RoutingError (No route matches [GET] "/assets/autoNumeric.min.js.map")

It's due to the following line in autoNumeric-2.0.js

//# sourceMappingURL=autoNumeric.min.js.map

Using autonumeric without an input field

The original project provides a way to use the autonumeric fashion without attaching it to an input through the ES6 module calls. Is there something similar that's available here? Even if through jQuery and without ES6 imports?

Thanks!

Way to set number formatting defaults

I think right now the way to set defaults is as mentioned on the autoNumeric page:

    $(document).ready(function () {          
        $.extend($.fn.autoNumeric.defaults, {              
            aSep: '@System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberGroupSeparator',              
            aDec: '@System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator',
            aSign: '@System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol'
        });      

        $('selector').autoNumeric('init'); 

    });

Is there a way to set these defaults easier through this gem?
If not, that would be my feature request.

Of course setting global defaults is easy enough, I want an easy way to do this in dynamically in Rails, like updating it in the controller some way.

Gem::Package::PathError: installing into parent path is not allowed

With 1.9.46 I'm getting this error when trying to install the gem:

Gem::Package::PathError: installing into parent path /my/path/.rvm/gems/ruby-2.3.1@project/spec of
/my/path/.rvm/gems/ruby-2.3.1@project/gems/autonumeric-rails-1.9.46 is not allowed
An error occurred while installing autonumeric-rails (1.9.46), and Bundler cannot continue.
Make sure that `gem install autonumeric-rails -v '1.9.46'` succeeds before bundling.

With 1.9.43 everything works perfectly.

autoNumeric('destroy') not working

In the following example, I'm trying to do a fallback when a touch device is detected and the browser supports the input type number.

The problem is that, even after the autoNumeric('destroy') is called, the browser console still gives this error, after the user inputs some number and focus outside the input form:
Error: You must initialize autoNumeric('init', {options}) prior to calling the 'get' method

$(document).ready(function(){

  // Changes input type to number and disables autonumeric, to use the native
  // data input number type.
  if (Modernizr.touch && Modernizr.inputtypes.number) {
    $('.number-input-field').removeAttr('data-autonumeric');
    $('.number-input-field').autoNumeric('destroy');
    $('.number-input-field').attr('type', 'number');
    $(document).trigger('refresh_autonumeric');
  }
});

turbolinks support

First, your gem is simple amazing :D, but I have a little bug when I use it with turbo links, have you any solution to make it works?, because for now only works if I reload all the page

Using rails autonumeric plugin with dynamically generated fields.

Hi All,

I'm using the rails autonumeric plugin and it works great on everything except for dynamically generated fields. It seems that when a new field is added (with cocoon in my case or by some other means) the hidden input is not created if you run the initialize process as recommended by the autonumeric wiki.

$('table#captable').on('cocoon:after-insert', function(e, insertedItem) {
    $(item).find('td.numeric input:visible').autoNumeric('init', {vMin: '0', vMax: '99999999', aSep:','});
    $(item).find('td.dollars input:visible').autoNumeric('init', {asign: '$', mDec:','});
});

Is there a good way to handle dynamically added fields in this gem?

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.