###困っていること
Railsで退会機能を作っています。
user/1/retire というパスで退会の画面に進もうとしているのですが、以下のようなエラーがでてしまい進みません
###エラーメッセージ
Routing Error uninitialized constant UserController
コードは以下のとおりです。
###該当のソースコード
application.rb
<li><%= link_to '退会', user_retire_path(@user) %></li>
route.rb
resources :user do get 'retire' end
event_infos_controller.rb
def show @user = current_user @event = EventInfo.find(params[:id]) @tickets = @event.tickets.includes(:user).order(:created_at) end
users_controller.rb
class UsersController < ApplicationController before_action :authenticate def retire endr def destroy if current_user.destroy reset_session flash[:notice] = "退会が完了しました" redirect_to root_path else render :retire end end end
どうかおしえてください。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。