Watch this video to see some important RubyMine features, or read through the content below.
RubyMine provides many helpful features when coding:
- Navigation - It's easy to jump from one piece of code to a related one within your app. For example, you can jump from the view to the controller and from the controller to the views by clicking on arrows on the side:
You can also click ⌘-B on a method call to jump to the method implementation. This will even let you jump to the source code of gems you're using! To navigate to any file, enter ⌘-Shift-N and begin typing the file name.
- Documentation - You can quickly view the documentation for Ruby, Rails and gem methods by clicking on the method and clicking "View" -> "Quick Documentation" (or "External Documentation").
- Error Detection - Even though Ruby is not a compiled language, RubyMine can still detect certain kinds of errors as you type your code. If RubyMine is pretty sure that your code is incorrect, it marks it with a red squiggly line. (Possible issues are marked with grey squiggly lines.)
- Refactoring - RubyMine provides tools to help your refactor your code. For example, you can rename a variable and RubyMine will replace the correct instances of that variable with the new name.
RubyMine also provides useful tools to help with web development.
One useful feature is the ability to quickly compare your current code with previous versions. If you're been committing your code to git, you can quickly pull up your git history and click on earlier versions. Simply click on the "Show History" button in the toolbar. (You can make the toolbar visible by clicking on "View"->"Toolbar".)
RubyMine also lets you browse your local database. This can be a useful way to inspect your data without using the Rails console. Click on the database buttons to display your databases. Double-click on the development" database and on the table you want to explore. (RubyMine may need to download drivers to connect to the database; you can usually go with its default settings for this.)
RubyMine provides a built in Rails console, which you can start from the tools menu. This is the same console you would run from the terminal, but it's easier to code in it and it provides features such as syntax coloring.
RubyMine also provides tools to run rake, rails generators, tests and more from within RubyMine instead of from the command line. While you may find some of these useful, I recommend sticking to the command line for most of these tasks, at least for now. Rails documentation and other resources will assume you're using the command line, so you'll need to be familiar with it.