Displaying 1 result from an estimated 1 matches for "cmpt".
Did you mean:
cmpl
2008 Nov 28
3
Beginner: "NameError - uninitialized constant" when I create a model object
...eError in VandaController#att
uninitialized constant VandaController::Compute
Same code works fine if I don''t create the Compute object.
What did I do wrong?
Here is the Controller
class VandaController < ApplicationController
def att
@compute = Compute.new
@data1 = @compute.cmpt
end
end
Here is the Model
class Compute
def cmpt
return 5
end
end
And here is the view
<html>
<head>
<title>Model</title>
</head>
<body>
<h1>reading data from a model</h1>
<br>
<br>
Fetch : <%= @...