undefined method ‘scaffold’ for blogcontroller:class

If you get this “undefined method ‘scaffold’ for blogcontroller:class” in your rails application, when you run your application on your browser most likely you were trying out the Netbeans RubyWeblog Example to solve, follow the steps below:

1. Delete the rubyweblog project from the netbeans project Window. (Also check and make sure you delete “rubyweblog project” from it’s physical location on your hard drive and drop any database previously created in relation to the Netbeans RubyWeblog Example).

2. Create a rubyweblog_development database, as described below i.e if already have skip to 3.
Open a command window.
If it has not already been started, start the MySQL database server.
Type the following command to create the development database and press Enter.
mysqladmin -u root -p create rubyweblog_development
Note: If the root user does not have a required password, omit the -p argument

3. In the NetBeans IDE, choose File > New Project. Select Ruby in the Categories field and Ruby on Rails Application in the Projects field. Click Next. Type rubyweblog in the Project Name field. Accept all the other default settings. Click Finish to create the new project. The IDE creates the project directory with the same name as your project.

4. In the editing area, edit the database.yml by providing the password in the development configuration. Save and close the database.yml file.

5. Next For rails 2.0 aplications you generate the model, controller, migrate version and views with the following:

a. Navigate to your rubyweblog application via commandline Start > Run then type cmd and press enter. i assume your rubyweblog is located at C:\apps\rubyweblog.

b.Within blog project, right click on your Model folder, click “Generate” and select “Resource” from the menu.You can then place your attributes in the parameters field or alternatively type the following “ruby script\generate scaffold post title:string” in the command line and hit enter, This action generates the model, controller, migrate version and views for you.

6.In the Projects window, right-click the rubyweblog node and choose Migrate Database > To Current Version.This action updates the the database to include the posts table. The Output window indicates when the migration is complete.

7. Under the Configuration node, open routes.rb. Find the line:

# map.connect ”, :controller => “welcome”

Edit the line by removing the comment sign (#) using crtl+/ and changing welcome to posts. Expand the Public node, right-click index.html and choose Delete.

Choose File > Save All.
Click the Run Main Project button in the toolbar.

This action starts the WEBrick server, which is part of the Ruby on Rails framework, and launches the web browser. Following is the first page of the application.

Finally continue the Netbeans RubyWeblog Example “Doing More: Adding Another Field”.

Configuring IIS For NetBeans PHP Plugin

To install the PHP plugin and create an IIS web server profile:

1. Check if the PHP plugin is already installed: choose Tools > Plugins and switch to the Installed tab.
2. If PHP is not on the list of installed plugins, switch to the Available Plugins tab, select the PHP option in the list, and click the Install button.
3. In the NetBeans IDE main screen, switch to the Services tab, which shows a tree of available databases and web server profiles.
4. Position the cursor on the Web Servers node and from the context menu choose Add Web Server. The Add New Web Server Record dialog box opens.
5. In the Connection Name text field, enter the name of the web server profile(in this case enter “IIS ADMIN”) and from the Server Type drop-down list, choose one of the connection types:
* Local Web Server with file access. This option assumes that you have a web server installed on your local computer. Every time you run your PHP project, the IDE copies your source files to a specified directory under the web server document root.
* Remote Web Server with FTP access. This option allows you to deploy your PHP files to a remote web server via FTP.
Note: In the development environment using a local web server is recommended. Find how to configure FTP access here.
6. Click Next and choose the Manual Configuration option.
7. In the Apache config file Location text box, Leave it Blank.
8. Click Next.
9. In the Base Directory text field, enter the subfolder of the Document Root where your PHP files will be copied(for IIS ‘C:\Inetpub\wwwroot’ is the path to IIS root, now create a folder there and use that folder name only in the Base Directory text field with no path pointing to it just the name of the wwwroot subfolder you just created.).
10. Click Next.
11. For the Document Root Browse to ‘C:\Inetpub\wwwroot’ or any sub folders as you wish.
12. Click Finish.

For More information.. On the Netbeans PHP Plugin Click here