Rails controller doesn't recognize model
I am trying to build a very simple rails application.
When user submits a form I process some files on the server and display the results.
Clearly, I do not need a database for this. Howev开发者_Go百科er, I created a model so that I can put all my processing logic in it.
In in the controller, I call the process function in the model. for example
# action in controller
def my_action
MyModel.process(params)
end
However, when I run the server and submit the form, rails says MyModel is uninitialized
uninitialized constant MyController::MyModel
What am I doing wrong?
Where do you define MyModel? Is it in app/models/my_model.rb as Rails (to put it simply) expects it to be?
精彩评论