Using autocompletion feature 1. Type '<' 2. Invoke autocompletion popup (ctrl+space) 3. Choose '<%', press whitespace or enter and '%> will be inserted automatically
Thanks Roman - I was expecting an autocompletion like { }, ' ', " ", ( ) or [ ], that is the completion appearing immediately after typing the first part. I believe the correct code completion is "-%>", not "%>" i.e. the minus sign is missing. If I am correct here, is there someway of changing this?
Using autocompletion feature
1. Type '<'
2. Invoke autocompletion popup (ctrl+space)
3. Choose '<%', press whitespace or enter and '%> will be inserted automatically
Using action - RubyMine | Tools | Extensions | Erb | Insert '<%= %>
Thanks Roman - I was expecting an autocompletion like { }, ' ', " ", ( ) or [ ], that is the completion appearing immediately after typing the first part. I believe the correct code completion is "-%>", not "%>" i.e. the minus sign is missing. If I am correct here, is there someway of changing this?
Kind regards
Hi Paul.
I believe that both %> and -%> are valid, the later option trims any trailing spaces, AFAIK.
As for setup, I've setup r for <% -%> and re for <%= -%> using File -> Settings -> Live Templates -> under HTML/XML.
r:
Abbreivation e
Template test: <% $END$ -%>
Expand with: Default (Tab)
Content: RHTML (checked).
re is setup in a similar fashion.
I believe there a key shortcut (shift + cntrl + . - at least on my Lenny setup) that produces <%= %>.
HTH
Perfect! Thanks very much!