Permalink
Browse files

Prevent redirecting for json format

  • Loading branch information...
swaroopch committed Nov 29, 2011
1 parent 9e87450 commit 12cec060a9643c1b99f70efceb0de66c66616860
Showing with 5 additions and 3 deletions.
  1. +5 −3 app/controllers/book_controller.rb
@@ -11,9 +11,11 @@ def view
return
end
- if is_isbn10(@isbn)
- redirect_to :action => "view", :isbn => isbn_10_to_13(@isbn)
- return
+ unless request.format == 'json'
+ if is_isbn10(@isbn)
+ redirect_to :action => "view", :isbn => isbn_10_to_13(@isbn)
+ return
+ end
end
@prices = Bookprice.new(:isbn => @isbn)

0 comments on commit 12cec06

Please sign in to comment.