cart state for item in details page finnaly shows (arrggh worst kind of bugs)

This commit is contained in:
Senad Uka
2015-02-08 08:29:24 +01:00
parent 7770e59b81
commit 113b70e8fa
11 changed files with 139 additions and 37 deletions

View File

@@ -13,12 +13,18 @@ before do
content_type :json
# TODO: before running to production change this so that only specific
# domain is allowed
headers 'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST']
headers 'Access-Control-Allow-Origin' => 'http://localhost:3001',
'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST','PUT'],
'Access-Control-Allow-Headers' => 'Origin, X-Requested-With, Content-Type, Accept',
'Access-Control-Allow-Credentials' => 'true'
request.body.rewind
json_string = request.body.read
json_string = request.body.read
@json_params = JSON.parse json_string if json_string.length > 1
if request.request_method == 'OPTIONS'
halt 200
end
end
@@ -28,5 +34,3 @@ helpers Sinatra::Cookies
Dir[File.dirname(__FILE__) + '/controllers/*.rb'].each {|file| require file }