title: Ruby on Rails - Creating a route for a custom view
body: <p>I feel like I'm really close so I'll get to the point. I've created a new view file (app/views/subjects/screening.html.erb). That would place the new file next to the edit.html.erb, which I used as my template. My edit.html.erb file works as intended, which is really weird because I've copied the logic/routes/etc for my new file, and I'm not getting the same results.</p>
  
  <p>This is frustrating. The MVC is being mean. </p>
  
  <p>So here is the link to the page:</p>
  
  <p>subjects/index.html.erb</p>
  
  <pre><code>  &lt;% @subjects.each do |sub| %&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;%= link_to "edit", edit_subject_path(sub) %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= link_to "scr", screening_path(sub) %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= sub.subject_id %&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= sub.study_site == 1? "Seattle" : sub.study_site == 2? "Portland" : "nil"%&gt;&lt;/td&gt;
        &lt;td&gt;&lt;%= sub.treatment_group %&gt;&lt;/td&gt;
      &lt;/tr&gt; 
    &lt;% end %&gt;
  </code></pre>
  
  <p>Where the link to "edit" works, producing this URL 'localhost:3000/subjects/{:id}/edit'. And the link to "scr" does not, producing 'localhost:3000/screening.{:id}'.</p>
  
  <p>routes.rb</p>
  
  <pre><code>  resources :users
    resources :sessions, only: [:new, :create, :destroy]
    # resources :subjects, only: [:new, :create, :destroy]
    resources :subjects
  
  
  
    match '/signup', to: 'users#new'
    match '/signin', to: 'sessions#new'
    match '/signout', to: 'sessions#destroy', via: :delete
    match '/edit', to: 'users#edit'
  
    root to: 'static_pages#home'
  
    match '/help', to: 'static_pages#help'
    match '/about', to: 'static_pages#about'
    match '/contact', to: 'static_pages#contact'
  
    match '/subjects', to: 'subjects#show'
    match '/newsubject', to: 'subjects#new'
    match '/subjects', to: 'subjects#index'
    match '/showsubject', to: 'subjects#show'
    match '/editsubject', to: 'subjects#edit'
    match '/screening', to: 'subjects#screening'
  </code></pre>
  
  <p>Do I have to declare something extra because I added it manually? Any help would be greatly appreciated. Thanks.</p>