2

working on an api, using the rails-api and rabl gems, basing understanding off railscasts 348 and 322

currently getting

Missing template activities/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :rabl]}. Searched in:
  * "/Users/jd/Dropbox/honeybadgerconsulting/activitiesapi/app/views"

but best I can tell, my setup mirrors the screencasts, is there a detail i'm overlooking ?

controller is

class ActivitiesController < ApplicationController
  include ActionController::ImplicitRender

  def index
    @activities = Activity.all
  end

end

and path to rabl template is /app/views/activities/index.json.rabl

context of json.rabl

collection @activities

attributes :title, :vendor, :date, :start_time, :price

screenshot of files and dir strcuture

John
  • 1,246
  • 15
  • 34

1 Answers1

2

Your request URL has to end in ".json", rails thinks it's an HTML request.

Maurício Linhares
  • 39,901
  • 14
  • 121
  • 158
  • snap, i just notice that I wasn't requesting to the correct endpoint... i swear, i've done this before ! – John Jan 26 '14 at 21:06