Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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