Abdoul Aziz
Abdoul Aziz

Reputation: 1

Temporary scaffolding on rails 3

I'm new to rails and I'm actually reading a tutorial on it but unfortunately it's a very old one (2007). They talk about temporary scaffolding which is a one-line addition to a controller for example:

class StoryController < ApplicationController
  scaffold :story
end

I tried it in my project but I'be got this error:

Routing Error

No route matches [GET] "/story"
Try running rake routes for more information on available routes.

I thought maybe it's because I'm running a different rails version, maybe the syntax have changed... So my question is how do we perform temporary scaffolding on rails 3.

I previously had to set config.assets.enabled to false because I had a route error.

I'm running under:

Rails 3.2.13

Windows 8 pro 32-bits

Upvotes: 0

Views: 126

Answers (1)

Alex D
Alex D

Reputation: 30445

I'm very surprised to see this, because I wasn't around when Rails had this scaffold method you show. I've never heard of it before.

I searched the API documentation (and Rails source) and there is nothing like this now. Instead, there is the rails generate scaffold command. You can find more information at http://guides.rubyonrails.org/command_line.html.

As a suggestion: If you want to use a version of Rails from 2007, the tutorial you have now is fine. If you want to use a modern version, find a modern tutorial. The Ruby on Rails Guides site is good.

Upvotes: 2

Related Questions