title: Ruby Rails render form inheriting controller?
body: <p>Hi and thanks in advance for any help.</p>
  
  <p>I have an admin page: <code>views/admin/admin_page</code></p>
  
  <p>and a form located in: <code>views/videos/_new</code></p>
  
  <p>The form renders nicely inside of the <code>admin_page</code> however when I submit the form the url seems to inherit "admin" from either my <code>AdminController</code> or my <code>views/admin</code> folder and appends it to the url I specify in my form.  For instance the form below posts to <code>/admin/users/profile/videos</code>.  </p>
  
  <p>Can someone help me fix this, please?  </p>
  
  <pre><code>    videos/_new.html.erb
      &lt;%= form_for @video, url: 'users/profile/videos', controller: "videos", method: 'post', :html =&gt; { multipart: true } do |f| %&gt;
        &lt;div class="form-group"&gt;
         &lt;%= f.label :avatar %&gt;
         &lt;%= f.file_field :avatar, class: 'form-control' %&gt;
        &lt;/div&gt;
      &lt;%= f.submit 'Submit',class: 'btn btn-default' %&gt;
  </code></pre>
  
    
  
  <p>Routes:</p>
  
  <pre><code>    Rails.application.routes.draw do
        devise_for :users
          resources :users do
            resource :profile do
              resources :videos
            end
          end
        get 'admin/ad_pg', :to =&gt; 'admin#ad_pg'
      end
  
  Rake Routes:
  
  new_user_session GET    /users/sign_in(.:format)                          devise/sessions#new
              user_session POST   /users/sign_in(.:format)                          devise/sessions#create
      destroy_user_session DELETE /users/sign_out(.:format)                         devise/sessions#destroy
         new_user_password GET    /users/password/new(.:format)                     devise/passwords#new
        edit_user_password GET    /users/password/edit(.:format)                    devise/passwords#edit
             user_password PATCH  /users/password(.:format)                         devise/passwords#update
                           PUT    /users/password(.:format)                         devise/passwords#update
                           POST   /users/password(.:format)                         devise/passwords#create
  cancel_user_registration GET    /users/cancel(.:format)                           devise/registrations#cancel
     new_user_registration GET    /users/sign_up(.:format)                          devise/registrations#new
    edit_user_registration GET    /users/edit(.:format)                             devise/registrations#edit
         user_registration PATCH  /users(.:format)                                  devise/registrations#update
                           PUT    /users(.:format)                                  devise/registrations#update
                           DELETE /users(.:format)                                  devise/registrations#destroy
                           POST   /users(.:format)                                  devise/registrations#create
       user_profile_videos GET    /users/:user_id/profile/videos(.:format)          videos#index
                           POST   /users/:user_id/profile/videos(.:format)          videos#create
    new_user_profile_video GET    /users/:user_id/profile/videos/new(.:format)      videos#new
   edit_user_profile_video GET    /users/:user_id/profile/videos/:id/edit(.:format) videos#edit
        user_profile_video GET    /users/:user_id/profile/videos/:id(.:format)      videos#show
                           PATCH  /users/:user_id/profile/videos/:id(.:format)      videos#update
                           PUT    /users/:user_id/profile/videos/:id(.:format)      videos#update
                           DELETE /users/:user_id/profile/videos/:id(.:format)      videos#destroy
          new_user_profile GET    /users/:user_id/profile/new(.:format)             profiles#new
         edit_user_profile GET    /users/:user_id/profile/edit(.:format)            profiles#edit
              user_profile GET    /users/:user_id/profile(.:format)                 profiles#show
                           PATCH  /users/:user_id/profile(.:format)                 profiles#update
                           PUT    /users/:user_id/profile(.:format)                 profiles#update
                           DELETE /users/:user_id/profile(.:format)                 profiles#destroy
                           POST   /users/:user_id/profile(.:format)                 profiles#create
                     users GET    /users(.:format)                                  users#index
                           POST   /users(.:format)                                  users#create
                  new_user GET    /users/new(.:format)                              users#new
                 edit_user GET    /users/:id/edit(.:format)                         users#edit
                      user GET    /users/:id(.:format)                              users#show
                           PATCH  /users/:id(.:format)                              users#update
                           PUT    /users/:id(.:format)                              users#update
                           DELETE /users/:id(.:format)                              users#destroy
                      root GET    /                                                 pages#home
                  contacts GET    /contacts(.:format)                               contacts#index
                           POST   /contacts(.:format)                               contacts#create
               new_contact GET    /contacts/new(.:format)                           contacts#new
              edit_contact GET    /contacts/:id/edit(.:format)                      contacts#edit
                   contact GET    /contacts/:id(.:format)                           contacts#show
                           PATCH  /contacts/:id(.:format)                           contacts#update
                           PUT    /contacts/:id(.:format)                           contacts#update
                           DELETE /contacts/:id(.:format)                           contacts#destroy
               admin_ad_pg GET    /admin/ad_pg(.:format)                            admin#ad_pg
  </code></pre>
  
  <p>admin/ad_pg is my "admin page"</p>
  
  <p>Thanks again,</p>
  
  <p>Matt</p>