Created
October 10, 2011 18:56
-
-
Save simmo/1276187 to your computer and use it in GitHub Desktop.
Rails 3: Limit attributes return with JSON/XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
respond_to :html, :json, :xml | |
def show | |
respond_with @user = User.find(params[:id]), :except => [:password, :email] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment