-
-
Save joshuamiller/753565 to your computer and use it in GitHub Desktop.
This file contains 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
def create | |
respond_to do |format| | |
if @my_model.save | |
format.json do | |
render :json => @my_model.to_json(:methods => [:owner_name]) #owner_name is a method that returns owner.display_name | |
end | |
end | |
format html { ... } | |
else | |
format.json { errors... } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment