Adding Photo Upload to a Rails 3.2 App with Carrierwave
At Suntoucher we manage our file uploads with the carrierwave gem. We store the files on S3 because we deploy to Heroku. The fog gem manages the integration with S3. We use the rmagick gem for photo processing. Here is a step by step guide to implement file uploading in a rails 3.x application. 1. ...
Self Publish an Ebook
Here are the slides from my TechBrew presentation: Self publish and ebook. Self publish and ebook
Rails 3.0 Offline Application – Lessons Learned
We recently deployed an offline enabled page in an existing Rails 3.0 application. We started understanding how to implement offline functionality be watching the railscast on offline apps part 1. In this blog post we’d like to share what we had to learn beyond what Ryan Bates outlined in that screencast, especially when it came ...
Rails conditional validations dependent on parent model
I have a report model that has_may observations. has_many :observations I have a conditional validation in observations that depends on an attribute of report. When I wrote this code: validates_presence_of :type_of_monitoring, :if => Proc.new { |observation| observation.report.report_type.eql? “SM” }, :message => “is required” I got the following error: NoMethodError (undefined method `report_type’ for nil:NilClass): When ...
TypeError: can’t define singleton method “encode_with” for BigDecimal
Today I refreshed my development machine. When I got my Rails 3.0.7 application up and running my tests were not passing due to the following error: TypeError: can’t define singleton method “encode_with” for BigDecimal This was being triggered by a to_yaml call on the BigDecimal. I upgraded my Rails app from 3.0.7 to 3.0.9 and it ...
RefineryCMS – implementing the portfolio
If you want to show a gallery or listing of your portfolio items then make sure you go to the settings page and set Settings – Portfolio Has No Index – false Also, to make sure that your portfolio uses the portfolio pages instead of your default page. Go to the advanced settings for your portfolio ...


