29 Jul
2010
My latest project, UploadJuicer is running on Rails 3, and I’m loving it. Back in the Rails 3 beta 1 days, there were still a lot of rough edges, but beta 4 has been great so far. Until I wanted to upgrade UploadJuicer to Rails 3 RC (1). After the upgrade, I got this:
ActionController::RoutingError (uninitialized constant ApplicationController::AuthenticationHelpers)
AuthenticationHelpers happens to be the first module I include from ApplicationController, and it lives in lib/authentication_helpers.rb. After a bid of head-scratching as to why something that has worked for ages and ages in Rails suddenly stopped working (and in between a beta and an RC release, to boot!), I remembered this change in config/application.rb from running rake rails:update:
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
That looked promising, so I uncommented it, changed extras to lib, and bam, problem solved. Life on the edge is an adventure. :)
Comments : No Comments »
Categories : Ruby on Rails
20 Jul
2010
It says something about the sorry state of my blogging lately that my blog is the last place I’m announcing my latest project, Juicer. :) It’s a handy service for offloading image uploading and resizing from your web app. Now you don’t have to tie up your server to handle long uploads or to do a bunch of thumbnails. You can keep your app super-responsive for the core of what it does, and leave the uploads and resizes to us.
Though my blog is the last place I announced the project, it’ll be the first place I announce the Ruby gem that goes along with it. :) I just published a gem that uses the Juicer API (via RestClient) and makes it pretty easy to integrate Juicer with a Rails 3 app. I’ve done the hard work of getting the direct-to-s3 upload with swfupload working for you, so all you have to do is make a few tweaks to your model and you have uploads and thumbnails done for you. You can get at the gem (and a sample Rails 3 app) at Github.
We’ll be posting more about Juicer at the Juicer blog, but I imagine I’ll mention things about it here from time to time. :) And hopefully I’ll get around to posting some of the fun code-related things that make up the service.
Comments : 4 Comments »
Categories : AWS, Ruby, Ruby on Rails, Web Development
22 Apr
2010
This is simply awesome. Facebook launches a new API using OAuth2, making it much easier to integrate with Facebook from your Rails app, and Michael Bleigh quickly churns out a new oauth2 gem.
Having dealt with the pain of Facebook integrations recently, and having really enjoyed using OAuth, I had to dive in. The result is a new Rails Kit! :) The Facebook API Rails Kit gives you a sample Rails app that integrates with Facebook and shows you how to post to a Facebook user’s stream. Check it out — I think you’ll like it. I would have loved to have had this a few months ago. :)
Comments : 1 Comment »
Categories : Ruby on Rails
16 Mar
2010
Recently I received a request from another B2B SaaS vendor to integrate with Catch the Best, so their users could pull their data from Catch the Best into this app. This is a classic use-case for OAuth, so I dove in to learning how to make my Rails app an OAuth provider. Well, thanks to the OAuth gem and the OAuth Rails plugin, it only took an hour or two to do.
However, since it took a little longer than it should have to do some testing of the app from the console, I thought I’d post this code in case it proves helpful to someone else working on this. My goal was to manually verify that the access control (the before filter) was working properly, so I could email the details on the OAuth endpoint to this other vendor and be reasonably sure it would work well for them. Here’s the code:
Read the rest of this entry »
Comments : No Comments »
Categories : OAuth, Ruby on Rails
12 Mar
2010
I was banging my head against a Facebook Connect problem with one of my clients’ Rails apps recently, and I thought I’d share a useful tidbit I gleaned from the experience, in case it can spare someone else the headache I had.
This app originally supported just plain-old users who created an account at the site with a username and password. Then the client requested that I add Facebook Connect as an authentication option. Using the facebooker gem, most of the work was straightforward. If a user chooses the Facebook Connect option when signing up or logging in, a User record is created and a FacebookUser record is associated with that User. The real problem came with trying to log out a Facebook Connect user.
Read the rest of this entry »
Comments : 1 Comment »
Categories : Facebook, Ruby on Rails
Recent Comments