Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Commit

Permalink
Made it post the link and added fallback for no JS
Browse files Browse the repository at this point in the history
  • Loading branch information
deiga committed Apr 8, 2013
1 parent 8924e5c commit adb4d65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/shop/products/_product.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
= product.options.map(&:name).to_sentence
.product-link= link_to 'Katso lisää', shop_product_path(product.id)
- else
.product-link= link_to 'Lisää ostoskoriin', shop_shopping_cart_add_item_path(cart.id,product.id), remote: true, class: 'add-to-cart', "data-type" => :json
.product-link= link_to 'Lisää ostoskoriin', shop_shopping_cart_add_item_path(cart.id,product.id), method: :post, remote: true, class: 'add-to-cart', "data-type" => :json
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
resources :shopping_carts, except: [:index], constraints: { id: bson_id_regex } do
delete '/remove_item/:id', action: 'remove_item', as: 'remove_item'
post '/add_item/:id', action: 'add_item', as: 'add_item'
get '/add_item/:id', action: 'add_item', as: 'add_item'
end
get '/', to: 'shop#index'
get 'search', to: 'shop#search'
Expand Down

0 comments on commit adb4d65

Please sign in to comment.