Created
December 23, 2010 20:50
-
-
Save lukesh/753527 to your computer and use it in GitHub Desktop.
question.rb
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| | |
format.json do | |
if @my_model.save! | |
render :json => @my_model.to_json(:methods => [:owner_name]) #owner_name is a method that returns owner.display_name | |
end | |
end | |
format html do | |
if @my_model.save! | |
... | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment