I have a module in / lib
Module Info
class Inf
def getNum
num = Array.new
num.push(2,1)
end
end
In the informations_controller controller, I have "require Info" and the following code:
def index
@informations = Info::Inf.getNum().num
respond_to do |format|
format.html
format.json { render json: @informations }
end
end
But he always gives an error
Routing Error
uninitialized constant Info
Since the router I defined "root: to =>" information # index ", what might be missing?
source
share