Here's some simple code that isn't working:
module ApplicationHelper
def industries
industries = ['Agriculture','Food', etc.]
end
end
class User < ActiveRecord::Base
include ApplicationHelper
validates_inclusion_of :industries, :in => ApplicationHelper.industries
...
end
This code is failing when a user action is run with undefined method 'industries'
. Do you know how I can reference the helper (or preferably just industries) the right way?
Edit
Based on the code in Mauricio's answer below, how can INDUSTRIES
be accessed in a controller and a view? I'm having real trouble making industries accessible everywhere, but it really needs to be for my application.