why won't rails find rabl templates?
Asked Answered
R

1

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

Reese answered 26/1, 2014 at 20:40 Comment(0)
S
2

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

Supercharger answered 26/1, 2014 at 21:2 Comment(1)
snap, i just notice that I wasn't requesting to the correct endpoint... i swear, i've done this before !Reese

© 2022 - 2024 — McMap. All rights reserved.