KEEP IN TOUCH

Join Newsletter

CALL NOW

Share with:


Recent Posts





August 2010

Here’s a common pattern and good rails thing to know about: read_attribute(:symbol)

Basically what it does is read the attribute from the object’s database field, even if you have over-ridden the name of that attribute with a virtual attribute of the same name.

When using Paperclip to save an attached image, how do I get & store the dimensions of the image? Best way is to create two fields to store the width & height and then just populate those fields when the image loads. (Other solutions, like reading it dynamically each, incur a lot of unnecessary disk activity.) Be sure to checkout some basic tutorials on Paperclip if you are unfamiliar with it generally. (see references below 1 2 3)

Step by step instructions.

1. create a new file at lib/paperclip_processors/thumbnail_with_dimensions.rb

2. Paste the contents of this gist into the newly created file:
http://gist.github.com/343678

This is the 76th NY Tech meetup; September is going to be the 6th year anniversary. Nate has a little self back-patting before getting to the show. Nate toutes his work brokering a connection for NY high school students to get placed as interns at...

Read More