Skip to content

Instantly share code, notes, and snippets.

@ornerymoose
Created October 11, 2012 12:03
Show Gist options
  • Save ornerymoose/3871885 to your computer and use it in GitHub Desktop.
Save ornerymoose/3871885 to your computer and use it in GitHub Desktop.
Note there is only an index for this app: very simple. No form/edit/show anything like that (taken care of in the admin portion of the app).
def index
@listings = params[:search].nil? ? Listing.all : Listing.search(params[:search])
respond_to do |format|
format.js
format.html
format.json { render json: @listings }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment