heartcombo / responders

A set of Rails responders to dry up your application
http://blog.plataformatec.com.br/
MIT License
2.05k stars 156 forks source link

Template lookup order, and strict request format #214

Closed mkhairi closed 5 years ago

mkhairi commented 5 years ago

app/views/

image

class FeedbacksController < ApplicationController
  before_action :set_feedback, only: [:show, :edit, :update, :destroy]

  respond_to :html, :js, strict: true
end

When a request comes in, for example for an JS response, this steps happen:

Expected behaviour: 1) the responder searches for a template at feedbacks/new.js; 2) if the template is not available, is should lookup in application/new.js;

Current behaviour: 1) the responder searches for a template at feedbacks/new.js; 2) if the template is not available, feedbacks/new.html was invoked;

rafaelfranca commented 5 years ago

Thank you for the issue. The current behavior is the expected behavior. Template inheritance has no precedence over different formats.