Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Missing template for missing partial due to format confusion #5308

Closed
rgarver opened this Issue Mar 6, 2012 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

rgarver commented Mar 6, 2012

In Rails 3.2.2 if you render a template of a different format from the page (eg, embedding some json via jbuilder) the layout will start trying to render any partials as that format (json in the example earlier).

index.html.haml

%h1 Hi
:javascript
  window.userJSON = #{render(:template => "users/show.json").html_safe}

layouts/welcome.html.haml

%html
  %head
  %body
    =yield
    =render :partial => 'layouts/analytics'

The above will fail unless I append , :formats => [:html] to the analytics partial.

I've put together a simple example of the failure case below:

https://github.com/rgarver/rails-nested-formats

This may be related to #5025

@josevalim josevalim closed this in bcea8cd Mar 7, 2012

Owner

spastorino commented Mar 7, 2012

@rgarver please test it again, against 3-2-stable and let us know

Contributor

rgarver commented Mar 7, 2012

Looking good!

@drogus drogus added a commit to drogus/rails that referenced this issue Mar 17, 2012

@drogus drogus Add missing test for #5308 7130f91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment