컨트롤러에서만 작동하는 메서드를 사용해야하지만 변경하는 특성을 구현할 수 없습니다.업데이트 작업에서 객체 속성을 변경하는 방법은 무엇입니까?
def update
@website = Website.find(params[:id])
respond_to do |format|
if @website.update_attributes(params[:website])
if params[:website][:language] == "Auto"
@website.[:website][:language] = full_language("request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first")
end
format.html { redirect_to @website, notice: 'website was successfully updated.' }
format.js
else
format.html { render action: "edit" }
format.js { render action: "edit" }
end
end
끝에 내가 잘못 무엇
: 여기
내 업데이트 작업인가?