This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter do | |
@categories = Rails.cache.fetch("global/categories", expires_in: 10.minutes) do | |
Category.where("posts_count > 0").all | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In my app I made a helper method to help me render form rows and DRY up my code. | |
def form_row(form, input_type, symbol) | |
# Need to generate HTML like this | |
# <div class="clearfix"> | |
# <%= f.label :first_name %> | |
# <div class="input"> | |
# <%= f.text_field :first_name, html_options = {:class => 'xlarge'} %> | |
# </div> | |
# </div><!-- /clearfix --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
From: Ilya Grigorik <[email protected]> | |
Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
Subject: [PATCH] async rails3 | |
--- | |
Gemfile | 6 ++++++ | |
app/controllers/widgets_controller.rb | 6 ++++++ | |
app/models/widget.rb | 2 ++ | |
config.ru | 1 + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RULES | |
* Contest starts at exactly 1PM EST on Friday, February 27, 2009 | |
* Contest ends at exactly 5PM EST on Friday, February 27, 2009 | |
* THREE winners will receieve an unpurchase-able Tikaro Gearxel Nerd Merit Badge | |
* ONE winner will receive a QRCode patch from http://p8tch.com (John's other project) | |
You can see pictures here: | |
http://www.flickr.com/photos/tikaro/3181563185/ | |
HOW TO PLAY | |
* Take a picture that contains a Nerd Merit Badge somewhere in it, and post it |