나는 컨트롤러 중 하나를 삭제하기로 결정한 Rails 4 앱 (레일 3에서 업그레이드 됨)을 가지고 있습니다.UnknownFormat in Devise :: SessionsController # new
ActionController::UnknownFormat in Devise::SessionsController#new
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate_user!
respond_to :json
def index
gon.rabl
@user = current_user
gon.rabl "app/views/users/show.json.rabl", as: "current_user"
end
def markdown
require 'redcarpet'
renderer = Redcarpet::Render::HTML.new
extensions = {}
Redcarpet::Markdown.new(renderer, extensions)
end
helper_method :markdown
end
: 나는 여기에 내와 ApplicationController 지금의 모습입니다 before_filter :authenticate_user!
를 포함와 ApplicationController에 삭제 된 컨트롤러의 방법을 이동
당신은 완전히 옳았다,하지만 난 혼란 스러워요 이전의 컨트롤러 (내가 삭제 한 컨트롤러)를 json에만 응답하도록 설정했기 때문에 before_filter : authenticate_user!로 정상적으로 작동했습니다. – niftygrifty
기본적으로 모든 컨트롤러 (일반적으로)는 응용 프로그램 컨트롤러를 상속하므로 응답하도록 설정되어 있으면 j 아들, 그렇다면 그들은 모두 있습니다. devios 컨트롤러는 html에 반응하지 않는 한 약간의 변경없이 작동하지 않습니다. – Slicedpan
'respond_to : json' 비트를 포함하는 방법이 있습니까? 'respond_to : json, : unless == : devise_controller?'와 같은 것 (방금 시도했지만 작동하지 않음) – niftygrifty