Si tengo un bloque de código como este:¿cómo puedo generar json desde el método respond_to en los rieles?
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end
¿Cómo agrego algo así como
format.json
Algún consejo, punteros, las ideas vistas con agrado ...
Gracias amigo - Acabo de averiguarlo leyendo la guía - http://guides.rubyonrails.org/layouts_and_rendering.html ¡Pero me tienes allí más rápido! –