Skip to content

Instantly share code, notes, and snippets.

@pinglamb
Created November 4, 2011 05:11
Show Gist options
  • Save pinglamb/1338708 to your computer and use it in GitHub Desktop.
Save pinglamb/1338708 to your computer and use it in GitHub Desktop.
Model under multiple api version
class Api::V1::PhotosController < Api::V1::BaseController
class Photo < ::Photo
def to_hash
# ........
end
end
def index
render :json => Api::V1::PhotosController::Photo.all.collect(&:to_hash).to_json
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment