RuntimeError in PinsController#index: declare the formats your controller responds to in the class level RuntimeError in PinsController#index: declare the formats your controller responds to in the class level ruby-on-rails ruby-on-rails

RuntimeError in PinsController#index: declare the formats your controller responds to in the class level


At the top of your controller you'll need to add:

class PinsController < ApplicationController  respond_to :html, :xml, :json  ...end

You can read more about this mime-type on the API Dock


Thanks. Any clues why rails generate scaffold would create "broken" code. Shouldn't that line be added automatically?


paste config/application.rb

config.app_generators.scaffold_controller = :scaffold_controller

it works!