Skip to content

Instantly share code, notes, and snippets.

View davesag's full-sized avatar
:octocat:
Coding

Dave Sag davesag

:octocat:
Coding
View GitHub Profile
@davesag
davesag / frank.rb extract
Created February 14, 2011 23:57
setting r18n locale
# r18n will grab locale info from the session first and if it's not in the session, the browser, if it can.
# add this to your code to allow for a manual override of the session
before do
session[:locale] = params[:locale] if params[:locale] #the r18n system will load it automatically
end
Summary
-------
Heroku crashes consistently with an "Ouchie Guy" whenever a logged-in user of my app creates or edits any data.
Details
-------
See the app http://frank-demo.heroku.com
I can log into my app as a root user (with 'root' and 'password' to keep it simple) but from that point on any attempt to
* edit my profile
@davesag
davesag / my haml override.
Created September 27, 2010 02:25
i18n aware haml and erb template loader for Sinatra
helpers do
def haml(template, options = {}, *)
# template will either be the name of a template or the body of a template.
# if it's the body then it will contain a "%" symbol and so we can skip any processing
template_name = template.to_s
do_not_localise = false
if template_name.include?('%')