RubyMine 2016.3 Help

Rails-Aware Code Completion

In this section, you can find some examples of code completion that RubyMine provides for Ruby-on-Rails.

Completing parameters of migration calls

For Ruby on Rails, RubyMine provides resolve and code completion for the parameters of the following migration calls.

  • add_column, remove_column, change_column, change_column_default, rename_column
  • create_table, change_table, drop_table, rename_table
  • add_index, remove_index
  • add_timestamps, remove_timestamps

As you enter parameters, press Ctrl+Space to show the suggestion list. Use Ctrl+P to view which parameter is required.

rails_CodeCompletionMigration.png

Completing parameters of a certain format

Some methods expect parameters of a certain type. RubyMine suggests appropriate options in the suggestion list:

/help/img/idea/2016.3/rails_CodeCompletionValidate.png

Creating dynamic queries

When a variable holds a model object, RubyMine suggests suitable code completion:

/help/img/idea/2016.3/rails_CodeCompletion.png

Having selected the desired completion, you can create chained queries:

rails_CodeCompletionChainedQuery.png

See Also

Last modified: 22 March 2017