The redirect_to request_token.authorize_url (called from my controller) gives an error: XMLHttpRequest cannot load http://www.goodreads.com/oauth/author.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:3000' is therefore not allowed access.
in my controller, this def is called by $.ajax after button click: request_token = OAuth::Consumer.new( Goodreads.configuration[:api_key], Goodreads.configuration[:api_secret], :site => 'http://www.goodreads.com' ).get_request_token
redirect_to request_token.authorize_url
This is my ajax: $.ajax( url: "/my/readings/goodreads_oauth" type: 'POST' dataType: 'jsonp' data: title: $title author: $author review: $review rating: $rating success: (data) ->
if i put the request_token.authorize_url directly into my browser the page opens correctly. But won't work through redirect_to. Why won't the page open?
XMLHttpRequest cannot load http://www.goodreads.com/oauth/author.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:3000' is therefore not allowed access.
in my controller, this def is called by $.ajax after button click:
request_token = OAuth::Consumer.new(
Goodreads.configuration[:api_key],
Goodreads.configuration[:api_secret],
:site => 'http://www.goodreads.com'
).get_request_token
redirect_to request_token.authorize_url
This is my ajax:
$.ajax(
url: "/my/readings/goodreads_oauth"
type: 'POST'
dataType: 'jsonp'
data:
title: $title
author: $author
review: $review
rating: $rating
success: (data) ->
if i put the request_token.authorize_url directly into my browser the page opens correctly. But won't work through redirect_to. Why won't the page open?