Ruby on Rails Monday, April 3, 2017

I'm using nested resources users, addresses so in my routes I have:

resources :users do
  resources :addresses
end
resources :users
resources :adresses

In my controller create action if @address.save succeeds there's a redirect but what should i render if it fails validation? default is render :new i was thinking render 'users/addresses/new' but that fails and it renders /addresses/new

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a8f6885d-d48c-4ab2-8431-5822bbe51e4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment