Benjamin Curtis

Speculations on Web Development

Looking for Ruby and Rails Developers

| Comments

I’m on the hunt for development help, so if you’ve been working with Ruby and/or Rails for a while, and you’re looking for some contract hours to fill, I’d love to hear from you.

A fellow entrepreneur here in Seattle and I both need someone part-time, so between the two of us, we might be able to use all the hours you can spare. We’re both open to intermediate through advanced Ruby/Rails developers, with hourly prices from $60 to $120, with at least 10 to 20 hours available per week. Both of us are looking to work with a developer for an extended period of time, so this could be the beginning of a beautiful friendship. :)

My needs include getting help with RailsKits, and Catch the Best. If you end up helping me with RailsKits, that could lead to additional engagements, as I’m often getting requests from people looking for development help to tweak the Kits to meet their needs.

My entrepreneur friend is looking for help for his bootstrapped startup, which is in the early part of its development cycle. If you are on the more advanced end of the spectrum he’ll be looking to you to help coordinate the efforts of more junior developers, which means you’ll be able to focus on the bits you find interesting. :)

I won’t bore you with a required skills list — if you’ve been developing web apps for at least a year or two, then you’ll be comfortable with (or be able to quickly learn) the whole stack of technologies that we are using.

To get in touch and let us know you’d be interested in us throwing cash at you in exchange for your talents, please submit your info here. Be sure to include a link to your github profile, a brief run-down of your relevant experience, and your desired hourly rate. This is a contract/1099 arrangement.

Missing Attr_unsearchable in Ransack?

| Comments

If you are upgrading to ransack from meta_search, and you are missing being able to use attr_unsearchable to hide various model methods from search, you can add this to your model instead:

def self.ransackable_attributes(auth_object = nil)
  (column_names - ['company_name']) + _ransackers.keys
end

In this case, company_name will no longer be searchable with the dynamic scopes that ransack creates.

Easy Mobile Device Login for Rails Apps

| Comments

I read an article this morning on TechCrunch about an upcoming service that makes it easy for developers to add mobile logins to their web applications, and I thought I’d try something similar for a new project I’m working on.

If you use the Devise gem for managing logins for your Rails app, and you pass the :token_authenticatable to the devise method, then your users can log in with a link that includes an authentication token, bypassing the email/username and password login. With that in place, all you need to do is generate a QR code that encodes a link to your app with this authentication token included. Here’s how you can do that:

Following the instructions of the qr code gem, install the gem by adding gem 'rqrcode' to your Gemfile and running bundle install. Generating the code can be done in a HAML view like so:

- qr = RQRCode::QRCode.new(root_url(Devise.token_authentication_key => current_user.authentication_token), :size => 10, :level => :l)
%table
  - qr.modules.each_index do |x|
    %tr
      - qr.modules.each_index do |y|
        %td{ class: qr.dark?(x,y) ? 'black' : 'white' }/

This assumes that you have devise hooked into your User model, and the currently-logged in user is available to the view via the current_user method. Using the CSS from the rQRCode home page, this will display a QR code that can be scanned on a phone.

This will allow a user to log in to your app (using their laptop), scan the QR code on their phone, and then be logged in on their mobile browser. Easy. :)

Print Progress Bar Background Color in Chrome

| Comments

I’m working on a project today that uses Twitter Bootstrap, displays progress bars, and has a requirement to print those progress bars. Sadly, Chrome doesn’t like to print background colors by default, so printing the progress bars didn’t work so well. Here’s the trick to get it to work: -webkit-print-color-adjust:exact. This instructs Chrome to print the background color.

After that, adding a few more styles (in a print stylesheet) makes for nice-looking progress bars (SCSS):

.progress {
  background-image: none;
  -webkit-print-color-adjust: exact;
  box-shadow: inset 0 0;
  -webkit-box-shadow: inset 0 0;

  .bar {
    background-image: none;
    -webkit-print-color-adjust: exact;
    box-shadow: inset 0 0;
    -webkit-box-shadow: inset 0 0;
  }
}

Googlebot Gotcha

| Comments

Did you build your site thinking that googlebot can’t understand your javascript? I did, and I was a bit surprised when I learned I was wrong…