Rename the Import controller to Account::Import
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
class ImportsController < ApplicationController
|
||||
class Account::ImportsController < ApplicationController
|
||||
layout "public"
|
||||
|
||||
disallow_account_scope only: %i[ new create ]
|
||||
@@ -33,6 +33,6 @@ class ImportsController < ApplicationController
|
||||
import.process_later
|
||||
end
|
||||
|
||||
redirect_to import_path(import, script_name: account.slug)
|
||||
redirect_to account_import_path(import, script_name: account.slug)
|
||||
end
|
||||
end
|
||||
@@ -8,7 +8,7 @@
|
||||
<div>Create an account using data from a Fizzy export. Upload the exported .zip file below.</div>
|
||||
</header>
|
||||
|
||||
<%= form_with url: imports_path, class: "flex flex-column gap", data: { controller: "form upload-preview" }, multipart: true do |form| %>
|
||||
<%= form_with url: account_imports_path, class: "flex flex-column gap", data: { controller: "form upload-preview" }, multipart: true do |form| %>
|
||||
<label class="btn input--upload">
|
||||
<div data-upload-preview-target="placeholder">Choose a file…</div>
|
||||
<div data-upload-preview-target="fileName" hidden></div>
|
||||
@@ -14,7 +14,7 @@
|
||||
<% when "failed" %>
|
||||
<p class="txt-medium txt-negative">Your import failed.</p>
|
||||
<p class="txt-small">This may be due to corrupted export data or a conflict with existing data. Please try again with a fresh export.</p>
|
||||
<%= link_to "Try again", new_import_path, class: "btn btn--plain center txt-medium" %>
|
||||
<%= link_to "Try again", new_account_import_path, class: "btn btn--plain center txt-medium" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<span>Sign up for a new Fizzy account</span>
|
||||
<% end %>
|
||||
|
||||
<%= link_to new_import_path, class: "btn btn--plain txt-link center txt-small", data: { turbo_prefetch: false } do %>
|
||||
<%= link_to new_account_import_path, class: "btn btn--plain txt-link center txt-small", data: { turbo_prefetch: false } do %>
|
||||
<span>Import an exported account</span>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
+1
-2
@@ -7,10 +7,9 @@ Rails.application.routes.draw do
|
||||
resource :join_code
|
||||
resource :settings
|
||||
resources :exports, only: [ :create, :show ]
|
||||
resources :imports, only: [ :new, :create, :show ]
|
||||
end
|
||||
|
||||
resources :imports, only: %i[ new create show ]
|
||||
|
||||
resources :users do
|
||||
scope module: :users do
|
||||
resource :avatar
|
||||
|
||||
Reference in New Issue
Block a user