Rails, partials annotations, rubymine

201 Views Asked by At

I have a Haml partial, which is rendered in a few templates, and requires specific local variables.

I want let know to other developers and IDE's (rubymine) know which local variable dependencies this partial/template has. For example _actions.haml:

- # @param [DigRulingService] ruling capability service
- # @param [Dig] dig entry object

- if ruling.ruler_removable?(dig)
  - name = ruling.related_ruling(dig).ruler.present_name
  = link_to("Remove #{name}", "#")

- if ruling.invite_cancelable?(dig)
  = link_to("Cancel request", "#")

- if ruling.able_to_invite?(dig)
  = link_to("Send new Invitation", "#")

But rubymine does not understand those comments, and highlights ruling and dig as undefined.

How I can it tell Tubymine about that local variables, for higlights thay methods as undefined(if not exists), and unhighlights thay as undefined?

0

There are 0 best solutions below