Week 1: Signup

For Week 1, we decided to make our So Play We All topic signup and authentication with a time budget of 4 hours. I originally pushed for more time, but then other concerns ate a couple days, so I’m really glad it was low and I could crank things out the day before.

In the spirit of doing it live, here’s the link to Oaqn live, as ugly as it is now. The homepage cribs from the stock Rails template, but that template doesn’t even carry over to the signup and login pages. But I’m getting ahead of myself when I talk about templates…

But before I explain this week, let me call out the Week 0 responses, as we’re critiquing each others’ progress. Here’s mine, Jim’s (great analysis), and Luke’s. My response went up a couple days late. We hadn’t worked out in the rules what the penalty for that would be, so Jim and Luke judged that I’d get a pass this week (and we instituted a rule). I’m going to make it their last chance at getting funding me. They will rue the day they decided to pass it up. Rue the shit out of it.

I spent 30 minutes dropping in Devise for signup and authentication. I thought about customizing the views a little, then remembered that nobody would be viewing my app, anyways. It’s enough that it works. I also added CanCan for authorization, though I didn’t spend any time really configuring it. It will be used for controlling access to guild resources like items, forums, chat rooms, and for the admin interface. It wasn’t strictly needed yet, but it seemed worth the 15 minutes to drop it in.

When I started this project, I used Rails 3.1 rc1, which was released a day or two before, with the thought that I’d rather deal with a few rough spots than spend time upgrading later. This week gave me a bit of cause to doubt that, I burned at least an hour on issues related to 3.1.

I tried to drop in ActiveAdmin for an automatically generated basic admin interface onto my database, but it doesn’t support 3.1 yet. It didn’t look like a matter of a few days, so I horribly hacked away at the alternative rails_admin to get it installed.

The big new hotness in Rails 3.1 is the asset packager that DHH spent his RailsConf keynote on. It concatenates and compresses your CSS and JS even while keeping your custom code separate from library code.

Well, even given the new Heroku version, JavaScript asset packaging didn’t work on Heroku. The process of compiling and caching the JS the first time it was requested ran into a RAM limit and failed.

app[web.1]: Started GET “/” for at 2011-06-01 00:03:14 +0000
app[web.1]: Processing by HomeController#index as HTML
app[web.1]: Rendered home/index.html.haml within layouts/application (21.2ms)
app[web.1]: Compiled ~/app/assets/stylesheets/application.css (0ms) (pid 1)
app[web.1]: Compiled ~/app/assets/stylesheets/home.css.scss (14ms) (pid 1)
app[web.1]: Compiled ~/app/assets/stylesheets/players.css.scss (1ms) (pid 1)
app[web.1]: Compiled ~/app/assets/stylesheets/application.css (1ms) (pid 1)
app[web.1]: Compiled ~/app/assets/javascripts/application.js (1ms) (pid 1)
app[web.1]: Compiled ~/vendor/bundle/ruby/1.9.1/gems/jquery-rails-1.0.9/vendor/assets/javascripts/jquery.js (0ms) (pid 1)
app[web.1]: Compiled ~/vendor/bundle/ruby/1.9.1/gems/jquery-rails-1.0.9/vendor/assets/javascripts/jquery_ujs.js (0ms) (pid 1)
app[web.1]: Completed 500 Internal Server Error in 85ms
app[web.1]: ActionView::Template::Error (CALL_AND_RETRY_0: Allocation failed – process out of memory
app[web.1]: (in /app/app/assets/javascripts/home.js.coffee)):
app[web.1]: 3: %head
app[web.1]: 4: %title Oaqn
app[web.1]: 5: = stylesheet_link_tag “application”
app[web.1]: 6: = javascript_include_tag “application”
app[web.1]: 7: = csrf_meta_tags
app[web.1]: 8: %body
heroku[router]: GET oaqn.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=219ms bytes=972
app[web.1]: 9: .login
app[web.1]: app/views/layouts/application.html.haml:6:in `_app_views_layouts_application_html_haml___3142637803911799179_35459600′

After tinkering for a minute, I realized this is a problem every Rails 3.1 app is going to face, so I should just ignore the problem and wait until Heroku solves it properly.

I also snuck in some small stuff, like switching to Haml for HTML templating and adding headliner for setting up page titles.

Happy at having met the signup goal and kept my app chugging along on Heroku, I turned to TemplateMonster to pick up a theme. I’d heard nice things about them, and they looked to have a giant selection at good prices. I spent a few minutes searching and bought a theme, but it was not to be: their anti-fraud system was happy to charge my credit card but they refuse to deliver the template unless I fax them a photo of my physical credit card. I’ve asked support for any other way to settle their nerves (I’m on the road and don’t have a fax available), but given the clueless emails I’ve gotten so far I’m not optimistic. Can anyone recommend a favorite template site?

Expenses to for Weeks 0 and 1:
$9.95 Domain name
$63 Template

2 Responses to “Week 1: Signup”