Undefined method error(Instant Rails)

Im new to Ruby on rails.
I have installed Instant rails. created my application called “Project”.
then ->> generated model for it called “device”
then->>created a database called project_development and added a column
to db/migrate/001_create_devices.rb.
then->> run the rake db:migrate command.
then->> i generated a controller called “project_controller” and wrote
scaffold:device inside it.
after that i tried to access the application at
localhost:3000\project_controller but its giving error “undefined method
`scaffold’ for ProjectControllerController:Class”

Please help me out of it.

Thanks in advance

There might be a syntax error near the code where you turn on
scaffolding. Would you mind posting the code near the area where you
call scaffold?

On Jan 28, 6:51 am, Supriya A. [email protected]

class ProjectControllerController < ApplicationController
scaffold:device
end

where device is my model…

There needs to be a space.

scaffold :device

scaffold is the name of the method, and :device is a symbol
(prefixing : makes something a symbol in Ruby).

(Sorry for the late reply!)

It is best not to use scaffolding at all and hand code things if you are
trying to learn.

Supriya A. wrote:

class ProjectControllerController < ApplicationController
scaffold:device
end

where device is my model…

stop scaffolding, especially when you are learning.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs