Yeah, I could have left the respond_to block in place but sometimes I feel
it is in the way. Moreover, and I speak by very recent experience, a JSON
API should belong to a separate controller. I recently wrote a JSON API for
a personal project following the great Railscasts API series, especially
this one
http://railscasts.com/episodes/350-rest-api-versioning?view=asciicast.
This is the repo of my project, if you're curious
https://github.com/adamico/vigitox.

Andrea D'Amico


On Mon, Nov 11, 2013 at 7:43 PM, Akshat Pradhan <notifications@github.com>wrote:

> In app/controllers/notes_controller.rb:
>
> >    def create
> >      @note = Note.new(params[:note])
> >
> > -    respond_to do |format|
>
> @adamico <https://github.com/adamico> hey I was just curious, why did we
> delete respond_to block? Isn't it sane boilerplate code generated to give
> us a quick JSON API server, if needed?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/akshatpradhan/lending-round/pull/17/files#r7568405>
> .
>