This project is archived and is in readonly mode.
layout with :only/:except options makes other actions render without layouts
-
PreciousBodilyFluids
This bug is still present in RC2. Can anyone else reproduce this, to make sure it's not just me? This seems like a major problem with the layout system to me, and I'm not sure how it's gone unnoticed for so long.
-
Roberto Thais
I'm not sure if this is a bug. Why don't you simply do
render :layout => 'other_layout'inside your 'new' action? This will render the application layout for all the remaining ones.
-
PreciousBodilyFluids
It's pretty unexpected, don't you agree? Why would naming a layout for some specific actions imply that you want the others to go layoutless? And, of course, it goes against the Rails convention (of using the application layout as the default).
I actually have hacked around it by using render :layout in that one action, but with the release of Rails 3 I'm trying to standardize my apps on respond_with, and you can't use both an explicit render and respond_with in an action (double render error).
-
Cyrille
render :layout => 'other_layout'is definitely working however I personally think layout is better in controller class declaration
layout 'other_layout', :only => :newis not working for me as well
-
Cyrille
See also #3619 Conditional layouts ignore default application wide layout that seems to be related
-
Neeraj Singh
- Milestone set to 3.1
- State changed from new to open
- Tag set to rails 3
- Importance changed from to Low
It is not being ignored. Any fix is going to have some performance penalty unless the whole conditions track is compiled into a single method call the way it is done for before_filter callbacks.
-
Santiago Pastorino
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
-
PreciousBodilyFluids
- State changed from stale to open
[state:open]
I've reproduced this on the current 3-0-stable branch (and updated my reproduction: http://github.com/chanks/layout_bug). I tried it on master, but the app wouldn't even boot up, which is probably an unrelated issue with master.