The Projects window is the main entry point to your project sources. It shows a logical view of important project contents such as Source Files and Test Files (for Ruby Projects) or Controllers, Models, and Views (for Ruby on Rails projects). You can open the Projects window by choosing Window > Projects (Ctrl-1).
There are two types of Ruby projects that can be open in this window:
Ruby Projects. Projects without Rails support that have only Source Files and Test Files folders for the files. If you right-click the main project node for a Ruby project, you have a few Ruby project choices, such as New (add files), Generate RDoc, and Run Rake Task.
Ruby on Rails Projects. Projects with Rails support for models, views, controllers, and databases that you can test quickly from the IDE and run in the server configured with Rails. You can right-click the main project node and perform tasks like adding new files, generating models, views, and controllers, migrating databases, running Rake tasks, and so on.
For a view of your project that shows the actual directory structure, you can use the Files window, usually available on a tab next to the Projects window or by choosing Windows > Files (Ctrl-2). You can also change the default Projects window view from a logical view to a file view by choosing Tools > Options > Ruby > Platform tab to display that tab of the Ruby Options Window. Then uncheck Show Logical Project View, click OK, and restart the IDE to apply the new window setting.
The following list of tasks shows you some of the things you can do in this window with a Ruby or Ruby on Rails project node. For a complete list of tasks, see Working With NetBeans Ruby.
To perform this task...
Follow these steps
Add files to your project
In the Projects window, select the main project node and right-click it.
Select New and choose the type of file you would like to add.
In the New File wizard, specify the file name, location, and so on as needed, and then click Finish to create the file.
Edit files
In the Projects window, select the node for your project and, if necessary, double-click it to open the node.
Navigate to the file you want to edit and double-click it to open it in the editor.
Generate a model, a controller, a migration, an integration test, and so on
In the Projects window, select the main node for your Ruby on Rails project and right-click it.
Select Generate to open the Rails Generator dialog box.
Expand the Generate drop-down list and choose the item you would like to generate.
For examples of generating a model and a controller, see
Migrate a database
To migrate a database for a Ruby on Rails project (for example, add tables that you have defined in a model), right-click the main project node in the Projects window and choose Migrate Database > To Current Version.
You can also revert the database to an earlier version by choosing one of the other To Version choices.
For an example, see
in the tutorial "Creating a Ruby Weblog in 10 Minutes".
Run a Ruby or Rails application
If your project is not the main one, right-click the project node and choose Set as Main Project.
Click the Run Main Project toolbar button or press F6 or choose Run > Run Main Project from the main menu.
You see a Ruby project's output in a window at the bottom of the IDE.
A Ruby on Rails project runs in the server configured with Rails and displays in your default browser.
To stop the server, click the X button to the left of the server window at the bottom of the IDE.
Run a controller or view file
If you're in a controller or view file, press Shift-F6 to run the current file. Doing so starts the web server unless it's already running, then opens the browser on the URL corresponding to the current file.
Run tests on your project
For quick testing when editing a view or controller file, use Ctrl-F6, or Command-F6 on a Mac platform, to run the tests associated with the file.
For full details on testing Ruby and Rails projects, see