사용자 정보를 수정하려고하면 마지막에 인증 토큰을 표시하는 URL을 제외하고 '업데이트'를 클릭 한 후에 아무런 변화가 없습니다. 내가 omniauth 가입뿐만 아니라, 별도의 편집보기에 대한 사용자 정의 유증 컨트롤러를 추가하기 위해 고안 경로를 변경사용자 프로필을 편집 할 수 없습니다.
Unpermitted parameters: utf8, _method, authenticity_token, user, commit, format
: 로그는이처럼 보이는 허가되지 않은 매개 변수 오류를 보여줍니다. 라우트 : 여기
devise_for :users, path_names: {sign_in: "login", sign_out: "logout"},
controllers: {omniauth_callbacks: "omniauth_callbacks"}
devise_scope :user do
get "/info" => "registrations#info"
end
사용자 정의 고안 컨트롤러 : 여기
class RegistrationsController < Devise::RegistrationsController
def info
@user = current_user
if @user
render :info
else
redirect_to root_path
end
end
def update
@user = User.find(params[:id])
@user.update_without_password(devise_parameter_sanitizer.for(:account_update))
redirect_to user_path(current_user)
end
protected
def after_sign_up_path_for(resource)
'/info'
end
end
및 편집이다 :, 채팅 세션 당으로
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put}) do |f| %>
<%= f.input :name %>
<%= f.input :email %>
<% end %>
params' 해시와'허가되지 않은 params' 경고'를 포함하여 관련 서버 로그와 질문을 업데이트하시기 바랍니다. –
업데이트되었습니다. 감사합니다. 그게 니가 원하는거야? – user2759575
채팅에 대해 이야기 해 봅시다. http://chat.stackoverflow.com/rooms/48530/ror –