でたぞ不明点。
devise/registration/edit.html.erb
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
(中略)
<%= f.submit "Update" %>
</div>
<% end %>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
deviseのregistration、session等のnewやeditにはform_forが入っていて、
そのurlオプションにprefixパスが使われているが(上記コードだと上から1行目と下から3行目)、
rails routes
をしてもこのprefixが見つからない。
てなわけで調べたら、案外あっさりのお味噌汁だた。
参考:Devise's registration_path, how it's generated?
https://stackoverflow.com/questions/19645698/devises-registration-path-how-its-generated
Devise::Controllers::UrlHelpersにて、self.generate_helpers!というメソッドで規定しているらしい。
コードも見たけど、prefixパスはmethod = "#{action}#{module_name}_#{path_or_url}"
部分で作ってるんだろな。
てなわけで終了。
1R 2分3秒(メイウェザー VS 那須川より16秒早い)