Skip to content

Instantly share code, notes, and snippets.

@joanwolk
joanwolk / sample_controller.rb
Created April 10, 2012 12:58
This is a sample gist I'm creating as part of a talk for RailsGirls Berlin.
class MyController < ActionController::Base
def sample
# define an action here
end
end
@joanwolk
joanwolk / preferences_controller.rb
Created August 16, 2011 16:16
RSpec controller test using cookies
class PreferencesController < ApplicationController
def update
@subdomain = cookies[:subdomain_name]
@preference = Preference.find_by_subdomain_name(@subdomain)
if @preference.update_attributes(params[:preference])
flash[:success] = "Preferences for #{params[:preference][:subdomain_name]} updated."
redirect_to spaces_path
else
@token = session[:token]
@joanwolk
joanwolk / Gemfile.lock
Created August 9, 2011 13:41
gems with which webmock is being warned for deprecation in RSpec3
GIT
remote: git://github.com/intridea/omniauth.git
revision: 610bcc1ada0489fb33b80e12c288f613f97f109d
ref: 610bcc1
specs:
oa-core (0.3.0.rc1)
hashie
rack
oa-enterprise (0.3.0.rc1)
addressable (~> 2.2.6)
@joanwolk
joanwolk / gist:1111423
Created July 28, 2011 11:40
What used to be in config.ru before converting to a full Rails app
class WebApp
def call(env)
return [
200,
{'Content-Type' => 'text/html'},
['<a href="http://github.com/upstream/cobot_expiring_day_passes">cobot expiring day passes</a>']
]
end
end