Ignoring Log Files in Subversion

If you’re like most people, you use Subversion for version control in your Rails app. So let’s say you have your SVN repository all set up, and you’re making changes to your code. Whenever you run your app, things are written to the log file(s). Log files can grow quite large, and they really don’t [...]

Tags: ,

Using Find Conditions on ActiveResource Objects

If you have a Rails app (app #1) which needs to communicate with another Rails app (app #2), chances are that app #2 is set up as a Web Service, and its controllers are RESTful, and that in app #1 you’re using ActiveResource. In case you’re not familiar with ActiveResource, please check out this excellent [...]

Tags: , , , ,

Use termios Gem With Capistrano to Keep Your Password Hidden

This is a quick tip, but a good one. If you use Capistrano to deploy your Rails app (which, umm, you really should) you will probably have noticed that your password is echoed on the screen when you deploy. This has always made me kinda nervous (I tend to have a mini panic attack every [...]

Tags: , , , , , ,

Custom Validation Messages In Rails, the Clean and Easy Way

Rails rocks, but let’s be honest. If there’s one thing that sucks about it out of the box, it’s validation and error message handling. This is probably one of the most often asked about topics, and I’ve read dozens of tutorials and seen many plugins intent on fixing the issue.
So, let’s take a second [...]

Tags: , , ,

Resizable Rounded Corner Sliding DIVS

With the web 2.0 era in full swing, it’s hard NOT to find a site conforming to what seems to be the definitive web 2.0 look and feel. Unless you’ve been hiding under a rock for the past few years, you know what I mean by this. Sites (at least the updated ones) tend to [...]

Tags: , , , ,

Deploying to Multiple Environments with One Capistrano Recipe

For your average small-medium sized Rails app, you will likely be using Capistrano to deploy to your production server. Most Capistrano tutorials out there will painlessly (and by that I mean painfully) walk you through this. But as your app grows, you will likely need to deploy to more than one environment - test, [...]

Tags: , , , ,

Better Image Resize with attachment_fu and RMagick

One of the main problems I ran into when using attachment_fu to upload images is the resize functionality. Let’s say you’re letting users upload an avatar (and it’s not necessarily a square). Also, let’s not mess with thumbnails (a lot of other blog posts I’ve read on this subject specify a square thumbnail in addition [...]

Tags: , , , , ,