Browse Source

Turbo devise strikes again

pull/126/head
baarkerlounger 4 years ago
parent
commit
6630284b23
  1. 7
      app/controllers/users/registrations_controller.rb
  2. 39
      app/views/devise/registrations/new.html.erb
  3. 2
      app/views/organisations/users.html.erb

7
app/controllers/users/registrations_controller.rb

@ -1,4 +1,11 @@
class Users::RegistrationsController < Devise::RegistrationsController
skip_before_action :require_no_authentication
def new
self.resource = resource_class.new
respond_with resource
end
protected
def after_update_path_for(_resource)

39
app/views/devise/registrations/new.html.erb

@ -1,23 +1,28 @@
<h2>Sign up</h2>
<% content_for :before_content do %>
<%= govuk_back_link(
text: 'Back',
href: :back,
) %>
<% end %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= form_for(resource, as: resource_name, url: user_registration_path(), html: { method: :patch }) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %>
<%= f.govuk_email_field :email,
label: { text: "Email address" },
autocomplete: "email"
%>
<h1 class="govuk-heading-l">Invite user to submit CORE data</h1>
<%= f.govuk_password_field :password,
hint: @minimum_password_length ? { text: "#{@minimum_password_length} characters minimum" } : nil,
autocomplete: "new-password"
%>
<%= f.govuk_text_field :name,
autocomplete: "name"
%>
<%= f.govuk_password_field :password_confirmation,
autocomplete: "new-password"
%>
<%= f.govuk_email_field :email,
label: { text: "Email address" },
autocomplete: "email",
value: resource.email
%>
<%= f.govuk_submit "Sign up" %>
<%= f.govuk_submit "Continue" %>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>

2
app/views/organisations/users.html.erb

@ -2,7 +2,7 @@
<%= "Users" %>
<% end %>
<%= govuk_button_link_to "Invite user", new_user_registration_path, method: :post %>
<%= govuk_button_link_to "Invite user", new_user_registration_path, html: { "data-turbo" => "false" , method: :get } %>
<%= govuk_table do |table| %>
<%= table.head do |head| %>
<%= head.row do |row|

Loading…
Cancel
Save