Setting Default Rails View Extension

Hi, everybody!

Is there a way to change the default Rails view extension from .erb to haml? For example, when in a controller and Shift+Alt+N -> 3-view brings up the "Go to View" dialog with "No views found... Enter the name..." -> some_action.html.erb. I'd like this dialog to show some_action.html.haml for views that don't exist.

Sorry in advance if I've missed the obvious setting in RM.

Thanks

3 comments
Comment actions Permalink

Hi Nazar,

Such ability isn't implemented. I have several ideas and interested what do you think

1. In application.rb you can customized default rails generators behaviour:

# config/applicaton.rb
config.generators do |g|
  g.template_engine :haml
end


So RubyMine may parse and understand these settings and use it for generate view action

2. Another heuristic - to look at views of current controller and generate view with the same extension.

3. Probably at first 2) if no views found then use 1).  Does anybody use both haml and *.erb.html views in the same project?

I don't want to add direct setting for the extension in settings pane.
0
Comment actions Permalink

Hi Roman.

Thanks for your reply and input.

1. In application.rb you can customized default rails generators behaviour:

# config/applicaton.rb
config.generators do |g|
  g.template_engine :haml
end

So RubyMine may parse and understand these settings and use it for generate view action


The above would be my prefered method as long as it isn't too much trouble to code.

Does anybody use both haml and *.erb.html views in the same project?


I've got a small number of controllers that use both .erb and .haml views (don't ask why)

Again, thanks Roman

correct seppling mistakes

0
Comment actions Permalink

Ok, I've filed an issue - http://youtrack.jetbrains.net/issue/RUBY-8049. Please vote and track it.

0

Please sign in to leave a comment.