A better way to manage a controller's layout?

I am trying out the evaluation copy of RubyMine and really liking it. I did have a few questions I'm hoping you guys in the community could help me out with, though. I searched the help file and this forum but didn't find an answer, but if I missed something please link it for me.

Right now I'm wondering, in Rails, is there a better way to work with a controller's layout file than simply right-clicking the "Layouts" folder, going to "New->RHTML Template" and creating a ERB file with the same name as the controller? It seems like the Rails view of the project 'knows' that a layout is associated with a certain controller (for ./app/views/layouts/foo.html.erb RubyMine listd '(FooController)' after it) so I would think there would be a way to wire them up. For example, is there a way to create a layout while viewing a controller? Some sort of key-/menu- comman so that when I'm looking at FooController.rb I can just press something and create ./app/views/layouts/foo.html.erb? And is there a way to jump from a layout to a controller in the same way that I can jump from a controller's method to it's asscoiated view, with the little icon in the gutter?

Thanks for giving me any tips you can spare!

2 comments
Comment actions Permalink

Hello Matt,

We had such gutter icon in the past and we dropped it.  As far as I know people doesn't use frequently layouts with the names as controllers because often layouts are shared among controllers. Thus we decided not to move layout under corresponding controller node in Rails View and just show expected controller name(in parentheses) according naming conventions.

0
Comment actions Permalink

OK, that makes sense. Thanks for the quick reply!

0

Please sign in to leave a comment.