For some reason, when I visit my index action in my rails application, I get strange results. When it is the first time I find it, the results are checked, however, if I click on the link that leads me to another page and then click the back button, I get the json results on the HTML verse webpage.
Here is my controller:
class UsersController < ApplicationController respond_to :html, :json def index @users = User.all respond_with(@users) do |format| format.json { render :json => @users.to_json(:methods => :available) } end end end
source share