Skip to content

Instantly share code, notes, and snippets.

@pier-oliviert
Created December 10, 2014 15:44
Show Gist options
  • Select an option

  • Save pier-oliviert/b3be11722bad58e09b6e to your computer and use it in GitHub Desktop.

Select an option

Save pier-oliviert/b3be11722bad58e09b6e to your computer and use it in GitHub Desktop.
<!-- This work for a new contact, but will not for an existing contact -->
<%= form_for [contact.client, contact] do |f| %>
<% end %>
<!-- This work for an existing contact, but will not for a new contact -->
<%= form_for [contact] do |f| %>
<% end %>
Rails.application.routes.draw do
resources :clients do
resources :contacts, shallow: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment