0
0

More than 1 year has passed since last update.

Railsのdevice_token_authでArgumentError in DeviseTokenAuth::ConfirmationsController#show

Posted at

はじめに

この記事は2022年2月にまとめていた「細かいつまずいたことをメモしておく(2月編)をそれぞれ投稿した内容になります
解決方法が最新でない可能性もありますのでご了承ください

問題

device_token_authのShowアクションにアクセスしたところ以下のエラーが発生した

ArgumentError in DeviseTokenAuth::ConfirmationsController#show

そのようなルートはないというエラーだった

解決方法

/view/devise/mailer/confirmation_instructinos.html.erbを以下に変更すると治った

/view/devise/mailer/confirmation_instructinos.html.erb
<p><%= t(:welcome).capitalize + ' ' + @email %>!</p>

<p><%= t '.instruction' %> </p>

<%=# 下記の様に書かれているはずなので %>
<%# <p><%= link_to t('.action'), confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s}).html_safe</p> %> %>

<%=# こちらにいれかえる %>
<%=# redirect_url: message['redirect-url'] が最後にたされている %>
<p><%= link_to t('.action'), confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %></p>

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0