Skip to content

Instantly share code, notes, and snippets.

@lukesh
Created December 23, 2010 20:50
Show Gist options
  • Save lukesh/753527 to your computer and use it in GitHub Desktop.
Save lukesh/753527 to your computer and use it in GitHub Desktop.
question.rb
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