Yesterday I asked a quiostion about Rails 4 Enum and got answer.
So I have defined global Status
enum in #app/models/concerns/my_enums.rb
like this:
module MyEnums
extend ActiveSupport::Concern
included do
enum status: [:active, :inactive, :deleted]
end
end
Now im trying to get all defined properties in my Status
enum from controller, cannot access enum because it initializes when module included and if i include it in my controller I`ll get this error:
undefined method `enum' for HomeController:Class
How can I get this in my controller(like Product.statuses)?
=> {"active"=>0, "inactive"=>1, "deleted"=>2}