Respond_with not working Rails 3
- by MDM
As no one can help me with my UJS ajax problem I am trying "respond_with", but I am getting this error:
RuntimeError (In order to use respond_with, first you need to declare the formats your controller responds to in the class level)
Yet I have declared it in my controller:
class HomepagesController < ApplicationController
  respond_to :html, :xml, :js
  def index
    @homepages = Homepage.search(params[:search])
    respond_with(@homepages)
  end
Anyone has any ideas why.