An error is reported when scaffold is used in rails2.0.2.

Source: Internet
Author: User
Tags netbeans
Recently I learned ror and bought a book titled agile web development-applying rails for agile web development, version 2nd.

When the sixth chapter "task a: Goods maintenance" was completed, it was unable to proceed, and according to the book, the following Code Class admincontroller <applicationcontroller
Scaffold: Products
Def Admin
Render: text => "hello"
End
When running the end command, the following error is reported: Undefined method 'scaffold' for admincontroller: class is not supported. My girlfriend can only ask me for help. I remember how rails was running before. Why not? Is the version upgrade incompatible with earlier versions? Class and method change? (My girlfriend learned to use Ruby 1.8.6 and rails 2.0.2) So I quickly checked the information and found that rails2.0.2 stripped scaffold as a plug-in, that is to say, scaffold cannot be used directly in rails2.0.2. So I installed it first. Netbeans-right-click the project depot-select rails plugins-select new plugins-select scaffolding for installation. Or depot> Ruby script/plugin install http://dev.rubyonrails.com/svn/rails/plugins/scaffolding/ and then re-run the project, access, this Returns another error: Undefined method 'paginate' for # <admincontroller: 0x3b62210> dizzy, needless to say, this method should also be removed when rails2.0.2, and then check the information. It turns out to be a paging function, so let's reinstall it. I don't know why. I added it to netbeans.

SVN: // errtheblog.com/svn/plugins

But netbeans prompts that the search is successfully added, but the plug-in cannot be searched. No matter what the cause is, solving the problem is the most important. Next I will use tortoisesvn through

Depot> Ruby script/plugin install SVN: // errtheblog.com/svn/plugins/classic_pagination

To download the plug-in classic_pagination, and then copy the folder to the project's vendor \ plugins folder, for example, depot \ vendor \ plugins. Restart the project and access http: // 127.0.0.1: 3000/admin? Well, let's continue learning in books!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.