HTML Editor ">

Dr. Matt Lee (mattl)

Web standards, accessibility, free/open source software, old UNIX/TV/Music and occasional wargaming

Global variables in Rails (2007)

in app/controllers/application.rb
add:-
before_filter :foo
and then:-

def foo
@blah = Monkey.find(:first)
end

This had been bugging me for ages and it turns out that tgb had the answer. Spunky.

Published: Fri Mar 30 2007 08:28:29 GMT-0400 (Eastern Daylight Time) by