Productive Rails View Development in RubyMine

November 10, 2013 Jared Carroll

RubyMine includes several commands to simplify working with Rails views. In this post, we’ll look at OS X keyboard shortcuts for view navigation, creation, and previewing; ERB code generation and refactoring; and HTML code generation and navigation.

View Basics

Navigate from an action to its corresponding view with command + control + Up.


If an action doesn’t have a view, RubyMine will offer to create one.


Use command + control + Up again to navigate from a view back to its action.


Preview a view in a browser with option + F2.



Generate ERB expressions with command + shift + .

Use command + option + T to surround a selection with markup or ERB.


Refactor a selection into a partial with control + T.



Generate opening and closing HTML tags by entering a tag name followed by Tab, e.g., i m g Tab.

Use powerful Emmet abbreviations to easily generate markup.

section>ul#items>li{Item $}*4:


Change/rename a tag with shift + F6.

View a CSS selector’s declaration inline with option + Space.


Navigate to it with command + B.

Accurately search for its usage with usage search, e.g., option + F7 to “Find Usages”.


A Familiar Feeling

The Rails view equivalents of commonly used commands such as “Go to declaration”, “Rename”, and “Find Usages”, thankfully, have been designed to work with HTML tags and CSS selectors. Powerful code generation helps simplify tedious view ceremony. Add in a few more view-specific commands, and Rails view development feels just as productive as everything else in RubyMine.

About the Author


Capybara's save_page with CSS
Capybara's save_page with CSS

At Pivotal, we often use Capybara to write a suite of integration tests that navigate a browser through any...

5 Quotes Explain It All: Why Pivotal One Is A Game Changer for the Cloud
5 Quotes Explain It All: Why Pivotal One Is A Game Changer for the Cloud

Pivotal One launched earlier this week and the media coverage has managed to weave together a trend in the ...

SpringOne 2021

Register Now