I have expanded the standard Devise RegistrationsController using routes:
# use my own controller for devise registrations devise_for :users, :controllers => { registrations: 'registrations' }
In this controller, I have a new_from_invitation method. This method displays the user registration form if the user comes from an invitation.
I copied the devize / registration / new.html.erb file. So my custom registration form looks like this:
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
This raises an ArgumentError because the resource is zero. Same as resource name. Somehow, resource and resource_name helpers are available in the standard development / registration / new method, but I canβt figure out how to do this. And therefore, cannot find a way to get these helpers for my custom method. Any help would be greatly appreciated!
source share