You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, when I attempt to get /people/1.json, I do not see the json. I see html!
GET /people/1.json
<html><body></body></html>
The rails log looks like this:
Processing PeopleController#show to json (for 127.0.0.1 at 2011-07-01 11:03:00) [GET]
Parameters: {"id"=>"1"}
Person Columns (44.9ms) SHOW FIELDS FROM `people`
Person Load (0.7ms) SELECT * FROM `people` WHERE (`people`.`id` = 1)
Rendering template within layouts/application
Rendering people/show
Lead Columns (14.4ms) SHOW FIELDS FROM `people`
Completed in 173ms (View: 30, DB: 77) | 200 OK [http://localhost/people/1.json]
so it looks to me like rails is attempting to show json, but ends up rendering html. I'm confused.
If I explicitly tell the controller to not render a layout, then it shows the json no problem:
That works. Unfortunately I do not know rails views that well, otherwise I'd have submitted a patch with my issue. But can you guys think why my app is doing this?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Can you try changing your layout files name to application.html.erb ? Always best to include mimetypes. Should work the same and I think stop conflicting with RABL?
Hi,
I'm unsure if this is an application-specific problem, or what, but with my app I'm trying to use rabl and running into a snag.
So i have the following controller:
My show.json.rabl file looks like this:
My app/views/layouts/application.rhtml file looks like this:
Now, when I attempt to get /people/1.json, I do not see the json. I see html!
The rails log looks like this:
so it looks to me like rails is attempting to show json, but ends up rendering html. I'm confused.
If I explicitly tell the controller to not render a layout, then it shows the json no problem:
That works. Unfortunately I do not know rails views that well, otherwise I'd have submitted a patch with my issue. But can you guys think why my app is doing this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: