How to get human readable size in controller


     i know i can use human_size helper in views, but what if I need 

emit human readable size in the controller e.g. in an error message?


  • Programming can be fun, so can be cryptography, however they should
    not be
    combined …

find the relevant code from human_size, copy it, and put it someplace
that’s accessible to your models

Here’s a good suggestion:


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs