ActionController :: UnknownFormat when I use response_to + reply_with (Rails 4)

I can't figure out what happens when I request an index action, I get ActionController :: UnknownFormat, even the existing index.js file inside the views / products folder. Can anyone help me figure out what I am missing? I am 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 
+6
source share
1 answer

You must indicate the format in the petition, i.e.

get: show ,: user_id => user_id ,: format =>: json

+2
source

All Articles