harithski
harithski

Reputation: 686

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. However, 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?

Upvotes: 0

Views: 1356

Answers (1)

Martijn
Martijn

Reputation: 1719

Where do you define MyModel? Is it in app/models/my_model.rb as Rails (to put it simply) expects it to be?

Upvotes: 1

Related Questions