This way, you can extract blocks of code from a view into a partial view, and replace them with a call.
So doing, IntelliJ IDEA generates the name for the resulting partial view on the base of the user input in
accordance with the Rails naming conventions: if the suggested partial view name is
bar, the generated name is
To extract partial
- Open a view in the editor.
- Select the desired fragment of valid code. For example, in case of HTML, your selection must contain matching opening and closing tags.
- On the main menu, or on the context menu of the selection, choose .
- In the Extract Partial dialog box, specify the desired partial view name without extension and the leading underscore, and click OK.