Skip to content

Commit

Permalink
Add empty :new action to Spree::UsersController
Browse files Browse the repository at this point in the history
Without this, specs fail with
```
AbstractController::ActionNotFound:
        The new action could not be found for the :authorize_actions
        callback on Spree::UsersController, but it is listed in the controller's
        :only option.
```

I guess this is because the views are not in the standard place, thus
impeding Rails' ability to dynamically generate empty actions if
matching views are present. Anyways: This is good, because it's more
explicit.
  • Loading branch information
mamhoff committed Jan 25, 2024
1 parent 89c8d1b commit 4faf85b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/controllers/frontend/spree/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class Spree::UsersController < Spree::StoreController
skip_before_action :set_current_order, only: :show, raise: false
prepend_before_action :authorize_actions, only: :new

def new; end

def show
load_object
@orders = @user.orders.complete.order('completed_at desc')
Expand Down

0 comments on commit 4faf85b

Please sign in to comment.