Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[Patch] template missing with respond_to and namespaced controllers

#2618

hi, since the rework contained in this commit:

http://github.com/rails/rails/co...

I had a couple issues, one of them is that rails is not able to find templates for rendering when using respond_to block.

Simple example on a namespaced controller:


class Administration::PatientsController < Administration::HomeController

  def index

    respond_to do |format|
      format.html
      # format.js do ...
    end
  end

Template is missing

Missing template patients/index - {:formats=>[:html, :xml, :text, :html, :all], :locales=>["it"]} - partial: false.erb in view path /Users/kain/Sites/careme/app/views

the view files are in the usual place:


app/views/administration/patients/index.html.erb

if not using the respond_to block it renders the page correctly.

Reported by Claudio Poli · May 7th, 2009 @ 02:40 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: none

Activity

  1. Claudio Poli
    Claudio Poli
    • Tag set to edge, missing, template

    added a trace here: http://pastie.org/474696

    May 13th, 2009 @ 11:34 AM

  2. Claudio Poli
    Claudio Poli
    • Title changed from Template not found in edge to Template missing with respond_to and namespaced controllers

    I tried to narrow down the problem.

    http://github.com/rails/rails/blob/216309c16519d94a9e0aebf758029a78...

    http://github.com/rails/rails/blob/216309c16519d94a9e0aebf758029a78...

    keeping track of parts array I can see this (remember, namespaced controllers):

    without respond_to block:
    ["index", {:locales=>[:en], :formats=>[:html, :xml, :text, :html, :all]}, "administration/patients"]

    with respond_to block:
    ["index", {:locales=>[:en], :formats=>[:html, :xml, :text, :html, :all]}, "patients"]

    as you can see the last item should be "administration/patients"

    I'll investigate more on why this is happening, but if you have any idea it will be appreciated.

    May 13th, 2009 @ 12:08 PM

  3. Claudio Poli
    Claudio Poli
    • Title changed from Template missing with respond_to and namespaced controllers to [Patch] template missing with respond_to and namespaced controllers

    attached is a small patch that fixes the issue.

    May 15th, 2009 @ 10:49 AM

  4. Uitek
    Uitek

    Claudio's patch fixed the issue for me, what do we need to do to get this released?

    June 22nd, 2009 @ 12:55 AM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. José Valim
    José Valim
    • Assigned user set to José Valim
    • Milestone cleared.
    • Importance changed from to

    June 26th, 2010 @ 02:47 PM

  7. Bruno Michel
    Bruno Michel

    I can't reproduce this bug on rails master. It seems like it has been fixed and the ticket can be closed.

    June 26th, 2010 @ 03:05 PM

  8. José Valim
    José Valim
    • State changed from new to resolved

    June 26th, 2010 @ 03:27 PM

  9. Jeremy Kemper