This topic describes common tasks that you can perform with NetBeans Ruby and Ruby on Rails projects that are open in the Projects Window. For more detailed information, click the links in the right column.
To perform this task...
Follow these steps
Create a new Ruby or Ruby on Rails project
Choose File > New Project from the main menu to open the New Project wizard.
Select Ruby in the Categories list.
In the projects list, select either Ruby Application or Ruby on Rails Application.
Jump between a Rails action (a method in a controller file) and its
corresponding view (an .rhtml or .erb file)
Ctrl-Shift-A
Command-Shift-A (Mac shortcut)
Jump between a test file and its tested file
Ctrl-Shift-T
Command-Shift-T (Mac shortcut)
Migrate a database
To migrate a database for a Ruby on Rails project,
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.
Run a Ruby or Rails application from the IDE.
Right-click the project node and choose Run from the pop-up 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
that is configured for the project
and displays in your default browser.
To stop the server, click the X button to the left of the output window at the bottom of the IDE.
Run a controller action or view file
If you are in a view file, press Shift-F6 to run the current file.
If you are in a controller file, right-click in the action
and choose Run File from the pop-up menu.
The IDE starts the web server if it is not already running, and opens
the browser on the URL corresponding to the current file. If you
are passing data in the URL or are the application uses mapped routes,
you might need to
rewrite the URL.
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.
You can run a unit test by using the Run File or Test File options from the editor pop-up menu.
To open the Rails Plugins manager,
right-click a Ruby on Rails project node in the Projects window and
choose Rails Plugins.
Run Rake tasks
Right-click the project node and choose Run/Debug Rake Task
from the pop-up menu.
Optionally, enter a few characters in the Filter textbox
to filter the list. You can use the ? and * wildcards.
Select the task that you want to run.
If the task takes parameters, you can enter them in the
Parameters textbox. The IDE remembers the parameters from
the last time you ran the same task.
Click Run.
For more information, see
Use the interactive Ruby shell (irb) in the IDE
To open an interactive Ruby (IRB) shell in the IDE,
right-click a Ruby or Ruby on Rails project node in the Projects
window and choose Ruby Shell (IRB) from the pop-up menu.
The IRB shell opens in a tabbed window at the bottom of the IDE in the same
location as the Output window. The IDE looks at project's Ruby Platform setting
in the Properties manager to determine which interpreter to use.
The window's tab shows which interpreter is used.
Open a Rails Console
Right-click a Ruby on Rails project node and choose
Rails Console from the pop-up menu.
Change Project Settings
To change a project's settings, such as Ruby interpreter,
web server, or Rails environment, right-click the project
node and choose Properties from the pop-up menu to open
the Properties manager.
You can set up multiple configurations for a project. Open
a project's Properties manager and click New to create a
new configuration.
To change from one configuration to another, right-click
the project node and choose Set Configuration.