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
Please sign in to leave a comment.
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:
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.
Hi Roman.
Thanks for your reply and input.
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.
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
Ok, I've filed an issue - http://youtrack.jetbrains.net/issue/RUBY-8049. Please vote and track it.