Tutorials

Rails File Uploading 101

Murderers
Mike Clark has put together a stunningly simple tutorial covering how to create a complete file uploading and image resizing system in mere minutes using Rick Olson's attachment_fu plugin. What impresses me the most is that he shows how attachment_fu can automatically store uploaded files on Amazon's S3 service with only a few tweaks. This is a must read for Rails developers who haven't brushed up on their file upload techniques lately.

Read more →

How to ditch AppleScript and use Ruby instead

Matt Neuburg has put together a great article full of examples of using Ruby and AppScript in place of AppleScript to script operations under OS X. I hadn't bothered to try these Ruby->OS X bridges yet, but I followed Matt's simple examples with amazement. It's so simple! Within two pages Matt moves on to using Ruby to instruct Microsoft Excel to produce a graph based on data provided from Ruby and it'll only take you up to ten minutes to read the whole thing and get that far. Excellent piece.

Read more →

The Easiest Way To Start A New Rails Projects With SVN

You're about to start a new Rails project. Do you type rails <project name>? No, "Stop using the rails command", says Josh Susser. If you create a dummy / default Rails project that's set up just the way you like it with plugins, your own extensions, and all those carefully defined svn:ignore flags, you can just create a new Rails project with a simple svn copy. So simple, but I've totally missed this idea, and it's a real timesaver.

Read more →

19 Random Rails Tutorials

Railsforum-1
RailsForum.com has just announced the winners of their October Tutorial Contest. A lot of cool tutorials came out of the contest, so I wanted to link to them here.

1st place -
HOWTO: Make a Rails Plugin From Scratch by Danger Stevens.

2nd place -
Refactoring on Rails: Move to Model and Refactoring on Rails: Multiple Scopes in Controller by Ryan Bates.

3rd place -
HOWTO: Send Instant Messages in Rails

Other entries
Image uploads and resizing for Rails models with mini-magick
XSS and when h() just ain't enough
Creating Two Models in One Form
Editing Multiple Models in One Form
Test Helper: Clean, Custom Assertion Messages
Debugging on Rails: Reading Stack Traces
Introduction to Form Helpers
Programming Best Practices
Advice to Rails Beginners: Follow Conventions
Handy RJS Tips
Using Autotest with Rails on Windows XP machines
Creating Many Models in One Form
Creating a Variable Number of Models in One Form
Getting Started With RESTful Rails
Rails Migration For Beginners

Read more →

Protect Your Rails Application Against Spam with Akismet

Austrian development agency, Sparkling Studios, look at how to use the Akismet anti-spam system to check data submitted to your site and protect your application from spam. It works by signing up for a key from Akismet and using a Ruby Akismet library. Then whenever you want to check your data, you make a simple call and Akismet returns a true or false based on whether the system believes the data to be spam.

Read more →

How to create a UNIX /etc/init.d startup script with Ruby

Most init.d start-up scripts seem to be bash scripts, but you can write them with any language. Here's some template code I use to create my own Linux services. You can even add them to chkconfig to be started properly on startup, and they'll also work with RedHat / CentOS's service system straight off.

Read more →