prismicio / ruby-rails-starter

Starter project for Ruby on Rails – Works with any prismic.io repository
32 stars 21 forks source link

"no implicit conversion of String into Integer" when trying to use a "Private API" and forgetting to set any tokens first #1

Closed kylebolstad closed 10 years ago

kylebolstad commented 11 years ago

TypeError in ApplicationController#index no implicit conversion of String into Integer Extracted source (around line #7):

5 def index 6 begin 7 @documents = api.form("everything").submit(@ref) 8 rescue Prismic::SearchForm::RefNotFoundException => e 9 render inline: e.message, status: :not_found 10 end

dohzya commented 11 years ago

Thank you for your alert!

This error was due to a double problem: the access token was not provided in some requests (so a 401 error was returned) and the API did not catch this error and try to parse the non-received response data…

These issues has been fixed in the commit d6300dd139e9d3cd6819a5065dc457c1b709b57f so just update your starter (not that we now use the 1.0.0.preview.2 version of the prismic.io gem) and it should work like a charm :-)

Please come back if you find any other problems ;-)

dohzya commented 10 years ago

I close this issue, please reopen it if the problem persists :-)