Skip to content

Instantly share code, notes, and snippets.

@adrianobrito
Last active August 29, 2015 14:07
Show Gist options
  • Save adrianobrito/0f4063949a7800f351b8 to your computer and use it in GitHub Desktop.
Save adrianobrito/0f4063949a7800f351b8 to your computer and use it in GitHub Desktop.
Comentários Controller
class Api::V1::ComentariosController < Api::V1::BaseController
def create
comentario = Comentario.create(params[:comentario])
if comentario.valid?
respond_with(comentario, :location => api_v1_comentario_path(comentario))
else
respond_with(comentario)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment