Search code examples
rubyrubymine

How can I use Rubymine to automatically convert a ruby block from curly braced style to begin..end style and vice versa?


I'm using Rubymine and wondering, how can I convert a block from curly braced notation to begin..end and vice versa?

for example

loop do
end

to

loop {}

Solution

  • To toggle between do..end blocks and {``} blocks, place your cursor on the do (or open bracket) and press Alt + Enter. You see the option to toggle.