Skip to content

Jbuilder renders blank body with rails 5.0  #346

Open
@gsmetal

Description

@gsmetal

I have latest jbuilder (2.6.0) and latest rails (5.0.0).
API-controller hello:

class HelloController < ActionController::API
  def hello
    @hello = {a: 1, b: 2}
  end
end

routes:

  get '/hello', to: 'hello#hello', format: 'json'

When there is no folder views/hello it renders 204 No Content.
When I add this folder and hello.json.jbuilder inside like this:

json.hello @hello

it renders 200 OK with empty body.

With jbuilder (2.4.1) in same situation it renders as expected:

{
    "hello": {
        "a": 1,
        "b": 2
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions