jigar
1
I have a model with name Module
class Module < ActiveRecord::Base
set_table_name “modules”
belongs_to :tabs
…
end
Some how I am getting error : “undefined method `table_name’ for
Module:Class”
I assume this is happening because there is some class in rails with
same name, I would appreciate if some body can show me way to solve
this problem.
jigar
2
Jigar wrote:
I have a model with name Module
I assume this is happening because there is some class in rails with
same name, I would appreciate if some body can show me way to solve
this problem.
Not just in Rails, in Ruby! Module (capitalized) is a reserved word,
like Class. You’ll have to pick a different model name.
Jeff
jigar
3
Thanks you very much Jeff