Skip to content

Instantly share code, notes, and snippets.

@ScotterC
Last active December 14, 2015 07:39
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 ScotterC/5052515 to your computer and use it in GitHub Desktop.
Save ScotterC/5052515 to your computer and use it in GitHub Desktop.
# in app/controllers/products_controller.rb
def index
@products = Product.all
respond_to do |format|
format.js { render partial: 'shared/app/article',
collection: @products,
as: :object }
format.html
end
end
# replace index function with above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment