File Uploading with Ruby

Here’s how to get a file from the user to rails. Note: ruby’s CGI.rb accepts the multipart/form and saves the file to your /tmp directory. Rather than load and save the file again, we’re just going to copy it from /tmp. simple? not necessarily. Sometimes the permissions don’t get set properly during uploading. Don’t know […]

Who’s Online

So, how do you tell who’s online? If you’ve been subjected to the abomination that is myspace you’ll have seen that ‘online now!’ indicator. Well, here’s how I solved that one recently. First up, here’s a list of all the commands you’ll want. rake create_sessions_table script/generate model online script/generate migration add_user_id_to_session_table move to db-sessions rake […]

More Cracked-Out Scaffolding: element.twisty

For anyone following this, I’m slowly building you up to a fully-featured sortable, filtered scaffold helper library. You may recall we already built filtering with SELECT dropdowns. I’m going to add an input box and some sorting to that. First, though, we need a little sumthin sumthin to simplify the UI: the twisty! The twisty […]