Skip to content

Commit

Permalink
Move coupon code routes out of order resources
Browse files Browse the repository at this point in the history
Goal
----

As a SolidusStarterFrontend user, I want the coupon code routes moved
out of the order resource routes because the coupon codes controller
already depends on the current order. As such, the coupon code routes do
not need to maintain an order parameter.
  • Loading branch information
gsmendoza committed Oct 12, 2022
1 parent bc23b2d commit 2d0a3ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@
get '/orders/:id/token/:token' => 'orders#show', as: :token_order
resources :orders, only: :show do
resources :coupon_codes, only: :create
end
resources :orders, only: :show
resources :coupon_codes, only: :create
resource :cart, only: [:edit, :update] do
put 'empty'
Expand Down
2 changes: 1 addition & 1 deletion templates/app/views/orders/_coupon_code.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_tag order_coupon_codes_path(@order), method: :post, class: "coupon-code" do %>
<%= form_tag coupon_codes_path, method: :post, class: "coupon-code" do %>
<div class="coupon-code__input">
<div class="text-input text-input--small">
<%= text_field_tag 'coupon_code',
Expand Down

0 comments on commit 2d0a3ca

Please sign in to comment.