Question

I want to render my rabl template, but want to be sure it renders the proper http status code. For example, creating a user, should render a 201.

users_controller.rb

@user = a_user

render 'users/create'

create.json.rabl

object @user
attributes :id, :blah, :blah2
Was it helpful?

Solution

If you use

respond_with @user

rails will use the appropriate status code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top