I am using devise and the registration form shows at /signup path but I want another page with same registration form but with different text at the top.
I can see the signup page is in /views/devise/registration/new.html.erb but how to make a copy of it and to show it at /signup_new ?
EDIT - I am using
devise_for :users do
get 'signup_new', :to => 'devise/registrations#new'
end
and now with above code I have got the signup_new redirecting to the form but I do want some different text to be show at the top of it. How can I do it since right now, both /signup and /signup_new are pointing to same form/page. I tried to copy the new.html.erb and created signup_new.html.erb but this is not working
In your Devise view, just display different things based on the request url:
<% if request.fullpath.include?('signup_new') %>
<%= 'text 1' %>
<% else %>
<%= 'text 2' %>
<% end %>
Side note: you really should NOT have 2 different urls pointing to the same content, for Google it is called duplicate content.
you can update your routes.rb file as..
devise_for :users do
get 'signup_new', :to => 'devise/registrations#new'
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With