Skip to content

Commit

Permalink
Merge pull request #41 from hyoshida/cannot-destroy-a-variant
Browse files Browse the repository at this point in the history
Cannot destroy a variant
  • Loading branch information
YOSHIDA Cake committed Oct 8, 2015
2 parents 43150ad + c8b27ce commit 987d478
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def update

def destroy
@variant.destroy
redirect_to comable.admin_product_variants_path(@product), notice: Comable.t('successful')
redirect_to comable.admin_product_path(@product), notice: Comable.t('successful')
end

private
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/comable/admin/variants/edit.slim
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
.panel-body
p
= Comable.t('admin.confirmation_to_remove_product')
= link_to Comable.t('admin.actions.destroy'), comable.admin_product_path(@product), method: :delete, class: 'btn btn-danger'
= link_to Comable.t('admin.actions.destroy'), comable.admin_product_variant_path(@product, @variant), method: :delete, class: 'btn btn-danger'
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
it 'redirects to the variants list' do
variant = create(:variant, product: product)
delete :destroy, product_id: product.to_param, id: variant.to_param
expect(response).to redirect_to([comable, :admin, product, :variants])
expect(response).to redirect_to([comable, :admin, product])
end
end
end

0 comments on commit 987d478

Please sign in to comment.