Search Results

Search found 3 results on 1 pages for 'user336777'.

Page 1/1 | 1 

  • Rails: ValidationReflection and Formtastic not working together

    - by user336777
    I installed validation_reflection as a gem and out of the box it picked up on my validates_presence_of validations. But it is not picking up on any of the other default rails validations such as validates_format_of. I know from the documentation that i am supposed to add something like: config.reflected_validations << :validates_format_of to my config/plugins/validation_reflection.rb file (which didn't exist initially). I did this but nothing changed (i restarted the web server in between). I am not sure if it just isn't picking up on my file and loading validation_reflection.rb or if i have done something wrong. Anyone have any insights?

    Read the article

  • Help with Regex statement in Ruby

    - by user336777
    I have a string called 'raw'. I am trying to parse it in ruby in the following way: raw = "HbA1C ranging 8.0—10.0%" raw.scan /\d*.?\d+[ ](-+|\342\200\224)[ ]\d*.?\d+/ The output from the above is []. I think it should be: ["8.0—10.0"]. Does anyone have any insight into what is wrong with the above regex statement? Note: \342\200\224 is equal to '—'. The piece that is not working is: (-+|\342\200\224) I think it should be equivalent to saying, match on 1 or more '-' OR match on the string \342\200\224. Any help would be greatly appreciated it!

    Read the article

  • How can I get Ruby to treat the index of a string as a character (rather than the ASCII code)?

    - by user336777
    I am checking to see if the last character in a directory path is a '/'. How do you get ruby to treat the specific index of a string as a character rather than the associated ASCII code? For example the following always returns false: dir[dir.length - 1] == '/' This is because dir[dir.length - 1] returns the ASCII code 47 (rather than '/'). Any thoughts on how to interpret 47 as '/'? Or is there a completely different way to handle this in the first place? thanks.

    Read the article

1