Skip to content

Instantly share code, notes, and snippets.

@jtomasrl
Created October 15, 2013 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtomasrl/6993437 to your computer and use it in GitHub Desktop.
Save jtomasrl/6993437 to your computer and use it in GitHub Desktop.
def index
if params[:query]
respond_to do |format| # ActionController::UnknownFormat
if params[:type] == "name"
@items = @store.items.where(name: params[:query])
format.js
elsif parms[:type] == "category"
@items = @store.items.where(category: params[:query])
format.js
end
end
else
@items = @store.items
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment