0
나는 어떤 경우에도 로그 쇼 오류 후에 개체를 만들고 부울을 true로 설정하고 리디렉션하려고합니다.부울 값이 참인 경우 리디렉션을 제어하는 방법은 무엇입니까?
누군가가 어떻게 알 수 있습니까?
class BrandsController < ApplicationController
def new
@brand = current_user.build_brand(params[:brand])
end
def create
@brand = current_user.build_brand(params[:brand])
if @brand.save
redirect_to "#{new_user_path}?branded=#{@current_user.branded[1]}"
flash[:success] = "thank's".html_safe
end
end
end
무엇이 오류입니까? –
'@ brand.save'는 예외를 생성하는 것을하지 않는 한 부울입니다. – tadman