Ruby on Rails joins models for json output
问题 I'm trying to build a JSON API end point with Ruby on Rails. I followed the instruction in the following and was able to create JSON API for my models http://railscasts.com/episodes/350-rest-api-versioning?view=comments/ I have the following controller: /api/v1/movies_controller.rb class MoviesController < ApplicationController def index if params[:p].nil? p = 1 else p = params[:p].to_i end @movies = Movie.order("id DESC").page(p) end def show @movie = Movie.find(params[:id]) end end I need