Author: anthony

Rails, Paperclip, Custom Interpolation

To allow custom interpolations in the PaperClip :path designation, add the following to your config/initializers/paperclip.rb file: Paperclip.interpolates :custom_field do |attachment, style| attachment.instance.custom_field end   Where :custom_field is whatever field associated with your attachment model you’d like interpolated in your path.

Rails 4, AWS Elastic Beanstalk, and RDS

This guide shows you how to configure a Rails 4 app with AWS’s elastic beanstalk and RDS. First, install the elastic beanstalk command line tool on your local development box: $ sudo apt-get install git $ sudo apt-get install python-dev $ curl “” -o “” $ sudo python $ sudo pip install awsebcli   […]

Resolve Net::HTTPBadResponse: wrong status line

In Ruby/Rails, if you’re running into the following error: Net::HTTPBadResponse: wrong status line When attempting to post data to a secure (https) url, with something similar to: Net::HTTP::post_form(“”,{})   Then you can rewrite your request to avoid the exception like this: url = URI.parse(“”) http =,url.port) http.use_ssl = true request =,{}) request = […]