The Main Screen
NetBeans, like many IDEs, is separated into three panes. The left pane holds a project or file explorer. In the screenshot the left pane is empty because there's no project generated yet. The right pane is split between the content pane (showing a welcome page) and an info pane. The info pane will show things like the output from generators, scripts, etc. Anything you'd normally see on a console window will show up in the info pane.
Generating a New Project
To generate a new project, go to File -> New Project. You'll be presented with a number of project types; choose Ruby on Rails Application. There are a number of options you must select here.
For the database type, configure as shown if you're using MySQL. There are a number of ways to do the database connection, but this is the most direct. Be sure to put in your correct password.
Also, you might want to change the server to Webrick.
It's familiar to most Rails coders, even though, for the most part, Mongrel has replaced it.
Everything in its Right Place
Most of the Rails commands are hidden away in the project's right-click menu. Right-click on the project name in the left pane. From this menu, you can do a number of things, including running migrations, installing plugins and running generator.
Create the Database
Before you get started installing any plugins or running any generators, you should first create your development database. To do this, select the Run/Debug Rake Task from the right-click menu. This will present you with a dialog listing all rake tasks available on your project. Either search through these manually or use the filter field in the dialog to narrow the choices down. In this screenshot, I'm going to run the db:create rake task.
Install Plugins
Select the Rails Plugins... option from the right click menu to get this handy plugins dialog. Make sure to stop by on the Repositories tag and enter any repositories you'll need. Select the plugin you need to install and hit the Install button. (It really couldn't be any simpler.)
From the right click menu, select Generate to access the generate dialog. This dialog will allow you to select a generator, input parameters in the one or more text fields at the top and run the generator. Also, in the bottom pane you'll be able to read the help screen for the generator.
Once you have a migration ready to run, you can run it from the Migrate Database sub-menu of the right click menu. All database migrations will be listed here, as well as To Current Version and To Version 0. To migrate to the latest version of the database, select To Current Version. Selecting any of the specific versions from the lower portion of the menu will migrate the database forward or backward to that version.
NetBeans, like many IDEs, is separated into three panes. The left pane holds a project or file explorer. In the screenshot the left pane is empty because there's no project generated yet. The right pane is split between the content pane (showing a welcome page) and an info pane. The info pane will show things like the output from generators, scripts, etc. Anything you'd normally see on a console window will show up in the info pane.
Generating a New Project
To generate a new project, go to File -> New Project. You'll be presented with a number of project types; choose Ruby on Rails Application. There are a number of options you must select here.
For the database type, configure as shown if you're using MySQL. There are a number of ways to do the database connection, but this is the most direct. Be sure to put in your correct password.
Also, you might want to change the server to Webrick.
It's familiar to most Rails coders, even though, for the most part, Mongrel has replaced it.
Everything in its Right Place
Most of the Rails commands are hidden away in the project's right-click menu. Right-click on the project name in the left pane. From this menu, you can do a number of things, including running migrations, installing plugins and running generator.
Create the Database
Before you get started installing any plugins or running any generators, you should first create your development database. To do this, select the Run/Debug Rake Task from the right-click menu. This will present you with a dialog listing all rake tasks available on your project. Either search through these manually or use the filter field in the dialog to narrow the choices down. In this screenshot, I'm going to run the db:create rake task.
Install Plugins
Select the Rails Plugins... option from the right click menu to get this handy plugins dialog. Make sure to stop by on the Repositories tag and enter any repositories you'll need. Select the plugin you need to install and hit the Install button. (It really couldn't be any simpler.)
From the right click menu, select Generate to access the generate dialog. This dialog will allow you to select a generator, input parameters in the one or more text fields at the top and run the generator. Also, in the bottom pane you'll be able to read the help screen for the generator.
Once you have a migration ready to run, you can run it from the Migrate Database sub-menu of the right click menu. All database migrations will be listed here, as well as To Current Version and To Version 0. To migrate to the latest version of the database, select To Current Version. Selecting any of the specific versions from the lower portion of the menu will migrate the database forward or backward to that version.
SHARE