Hi,

I'm trying to update shoulda gem to be Rails 3 compatible and got a
problem with fetching layout name. There's the following code in
shoulda:

    @controller.response.layout

which in Rails 2 returns i.e. 'layouts/application'. When this code is
executed in Rails 3, Rails prints out deprecation warning that
'template.layout' should be used instead. However, the 'template'
method is defined in ActionController::Compatibility module and
returns 'view_context' object. Additionally it has the following
comment: "TODO: Remove this after we flip" :) So, is the deprecation
message mentioned above already deprecated? :)

What's the proper way to fetch layout name?
@controller.template.layout? @controller.view_context.layout? Besides,
response.layout returns just a layout name, while template.layout
returns a full path to a layout file (i.e. "/Users/.../views/layouts/
application.html.erb") - is there a way to get response.layout like
result in Rails 3?

Cheers,
Szymek

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to