# Rename refactorings

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

> **TL;DR**
> Shortcut: `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `Ctrl+R, R` (Visual Studio), `⌘ R, R` (Visual Studio (macOS)), `Shift+F6` (TextMate), `Ctrl+R` (NetBeans), `Alt+Shift+R` (Eclipse), `⇧ F6` (Eclipse (macOS))
>
>
>
> Main menu: `Refactor | Rename`
>
>
>
> Context menu: `Rename`
>
>
>
> [General refactoring settings](code-editing.html): `Settings | Editor | Code Editing`

Use the Rename refactoring to change names of symbols, files, directories, Rails application components, Rails named scopes, Rails fixtures, and so on. RubyMine automatically changes all the references to renamed items throughout code.

Renaming local variables or private methods can be done easily inline since only the limited scope is affected. Renaming classes or public methods could potentially impact a lot of files. In this case, we suggest that you preview potential changes before you refactor.

The procedure below demonstrates how to rename a class method.

Procedure:

1. Place a caret at the method name:

![place caret](https://resources.jetbrains.com/help/img/idea/2026.3/rm_refactoring_rename_caret.png)

2. Press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `Ctrl+R, R` (Visual Studio), `⌘ R, R` (Visual Studio (macOS)), `Shift+F6` (TextMate), `Ctrl+R` (NetBeans), `Alt+Shift+R` (Eclipse), `⇧ F6` (Eclipse (macOS)) or select `Refactor | Rename...` from the main menu.

3. Specify a new method name in the invoked dialog and click Refactor:

![Rename dialog](https://resources.jetbrains.com/help/img/idea/2026.3/rm_refactoring_rename_dialog.png)

4. In the Refactoring Preview window, inspect code changes to be made and click Refactor:

![Refactoring Preview window](https://resources.jetbrains.com/help/img/idea/2026.3/rm_refactoring_rename_preview.png)

## Example

| Before | After |
| --- | --- |
|     ```RUBY class Song   def initialize(name, artist)     @name = name     @artist = artist   end   def to_s     "Song: #{@name}--#{@artist}"   end end  song = Song.new("My Way", "Sinatra") puts song.to_s ```    |     ```RUBY class Song   def initialize(name, artist)     @name     = name     @artist   = artist   end   def to_string     "Song: #{@name}--#{@artist}"   end end  song = Song.new("My Way", "Sinatra") puts song.to_string ```    |

