ActionController::UnknownFormat when I use respond_to + respond_with (Rails 4)

Viewed 2673

I can't understand what's happening, when I ask for index action I receive ActionController::UnknownFormat, even existing a index.js file inside views/products folder. Anyone can help me to figure out what I'm missing out? I'm using Rails 4 and Ruby 2.0.0-p247.

class ProductsController < ApplicationController
  respond_to :js
  def index
    @products = Product.published.newest.page(params[:page])
    respond_with @products
  end

end
1 Answers
Related