Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Created November 4, 2010 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sideshowcoder/661956 to your computer and use it in GitHub Desktop.
Save sideshowcoder/661956 to your computer and use it in GitHub Desktop.
render :action => "new" does not call method new
def new
@a = A.new
@b = @a.b
end
def create
@a = A.new(params[:a])
@a.b_id = B.find(params[:b_id]).id
if @a.save
redirect_to(@a.b)
else
render :action => "new"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment