2017-10-04 5 views
1

active-admin user.rb 파일에 사용자 정의 컨트롤러를 추가했습니다. active-admin에서 사용자 세부 정보를 업데이트하는 동안 사용자 정의 된 컨트롤러에서 update 메소드를 호출합니다. 내가 직면 한 실제 문제는 그것이 표시되지 않는 메서드 안에 플래시 메시지를 포함 할 때입니다.활성 관리자 오류 메시지가 표시되지 않습니다.

controller do 
    def update 
    @user = User.find(params[:id]) 
    @user.update(expert_params) 
    redirect_to temanage_user_path(@user), :notice => "attempting to set notice via redirect_to" 
end 

답변

0

controller do 
    def update 
    update! do |success, failure| 
     success.html do 
     redirect_to temanage_user_path(@user), notice: 'Updated! Redirecting.' 
     end 
    end 
    end 
end 

P.S. 시도 @user가 이미 설정되어 있어야합니다.

+0

나를 위해 일하지 않습니다. Mr. @Piers. 이 문제를 해결할 다른 솔루션이 있습니까 아니면 어떤 디자인 오버 라이드 bcz 일어나고 있습니까? –