title: How to display form elements when using shallow nesting in rails?
body: <p>I'm using shallow nesting in Rails, similar to the example <a href="http://www.xyzpub.com/en/ruby-on-rails/4.0/routes_resources.html#routes_nested_resources" rel="nofollow noreferrer">here</a></p>
  
  <p>My routes.rb is configured with:</p>
  
  <pre><code>  resources :applications do
      resources :domains, shallow: true
    end
  </code></pre>
  
  <p>I have used rails scaffold to generate both models and associations, in order to add new domain to application, I can get there via </p>
  
  <p><strong><em>option #1</em></strong> </p>
  
  <pre><code>   /domains/new
  </code></pre>
  
  <p><strong><em>option #2</em></strong> via its parent resource</p>
  
  <pre><code>   /applications/:application_id/domains/new
  </code></pre>
  
  <p>Currently the form displays drop down to associate domain with its parent upon creation. </p>
  
  <p><a href="https://i.stack.imgur.com/DFVh2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DFVh2.png" alt="enter image description here"></a></p>
  
  <p>How can I hide this dropdown menu option if user get to the form via option 2 and display if if user get to the form via option 1? </p>
  
  <p>Your thoughts is highly appreciated.</p>
  
  <p>Thanks</p>