Skip to content

Commit

Permalink
Fix to allow rails activestorage to not match on unmatched routes
Browse files Browse the repository at this point in the history
  • Loading branch information
kitallis committed Nov 9, 2022
1 parent 8dc0458 commit e7fdf82
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions config/routes.rb
Expand Up @@ -11,8 +11,8 @@
end

devise_for :users,
controllers: { registrations: "authentication/registrations", sessions: "authentication/sessions" },
class_name: "Accounts::User"
controllers: {registrations: "authentication/registrations", sessions: "authentication/sessions"},
class_name: "Accounts::User"

devise_scope :user do
unauthenticated :user do
Expand Down Expand Up @@ -100,12 +100,12 @@
collection do
get :connect, to: "integrations#connect", as: :connect
resource :google_play_store, only: [:create],
controller: "integrations/google_play_store",
as: :google_play_store_integration
controller: "integrations/google_play_store",
as: :google_play_store_integration

resource :bitrise, only: [:create],
controller: "integrations/bitrise",
as: :bitrise_integration
controller: "integrations/bitrise",
as: :bitrise_integration
end
end
end
Expand All @@ -128,6 +128,7 @@
get :callback, controller: "integration_listeners/slack", as: :slack_callback
end

match '/', via: %i[post put patch delete], to: 'application#raise_not_found', format: false
match '*unmatched_route', via: :all, to: 'application#raise_not_found', format: false
match "/", via: %i[post put patch delete], to: "application#raise_not_found", format: false
match "*unmatched_route", via: :all, to: "application#raise_not_found", format: false,
constraints: lambda { |req| req.path.exclude? "rails/active_storage" }
end

0 comments on commit e7fdf82

Please sign in to comment.