September 2009
3 posts
5 tags
Ruby on Rails: String to Boolean
Really, this should be simpler. Knowing Rails folks there is probably some deep philosophical reason this isn’t included, but I hold no grudge.
So….I’m converting objects back and forth to JSON and when they return all my pretty Booleans are converted into strings. My assumption was that there was a handy little .to_b(ool) method for String, but alas there does not appear to...
7 tags
Ruby on Rails: Single Table Inheritance and...
I am writing this out of a bit of frustration. I have a solution here, but it took too long and it can not be correct. I am hoping some smarter folks will chime in with some thoughts.
I have a model called Questions which has many subtypes using single table inheritance. Basically types of questions dropdown, checkbox, radio, etc etc.
These are set up as resources so I can use restful...