Global variables in Rails

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.

  • Category: Old

Posted by Matt Lee

Artist, writer, director and recovering free software user.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.