Skip to content

Instantly share code, notes, and snippets.

@ileitch
Created August 22, 2011 15:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ileitch/1162618 to your computer and use it in GitHub Desktop.
Save ileitch/1162618 to your computer and use it in GitHub Desktop.
class SomeModel < ActiveRecord::Base
def some_method
raise NotImplementedError
end
end
module Api::V1::SomeModelMethods
def some_method
return {:blah => 1}
end
end
class Api::V1::SomeController < Api::V1::ApplicationController
class SomeModel
include Api::V1::SomeModelMethods
end
def index
render :json => SomeModel.all.map(&:some_method).to_json
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment