【发布时间】:2017-10-13 00:23:26
【问题描述】:
我正在尝试在移动设备上更新用户信息,但 Rails 日志显示:
有人知道为什么在移动模式下会发生这种情况吗?
缺少模板用户/更新,应用程序/更新与 {:locale=>[:"en"], :formats=>[:mobile], :handlers=>[:erb, :builder, :咖啡]}。搜索:
def update
@user = User.find(params[:id])
respond_to do |format|
format.html do
@states = State.all
@cities = City.where('state_id = ?', State.first.id)
if @user.update_attributes(params[:user])
redirect_to(action: :edit, id: @user, only_path: true, format: :html)
flash[:notice] = 'updated'
else
render :edit
end
end
format.json do
@user.update_attributes(params[:user])
render nothing: true
end
end
end
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3