Skip to content

Commit

Permalink
In respond_to blocks, prefer HTML over JSON if the request does not s…
Browse files Browse the repository at this point in the history
…pecify what it prefers
  • Loading branch information
carols10cents committed Sep 5, 2012
1 parent b36829c commit 19f0989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/updates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ def index
@list_class = "all"

respond_to do |format|
format.html { render_index(Update) }
format.json {
@updates = Update
set_pagination
render :json => @updates.map{ |u| UpdateJsonDecorator.decorate(u) }
}
format.html { render_index(Update) }
end

end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def show
headers['Link'] = "<#{user_xrd_path(@user.author)}>; rel=\"lrdd\"; type=\"application/xrd+xml\""

respond_to do |format|
format.html
format.json {
render :json => @updates.map{ |u| UpdateJsonDecorator.decorate(u) }
}
format.html
end

end
Expand Down

0 comments on commit 19f0989

Please sign in to comment.