Rails link_to标记不会更新网址

时间:2018-11-20 07:17:53

标签: ruby-on-rails ruby-on-rails-4 ruby-on-rails-5 ruby-on-rails-5.2

我的查看页面代码为

<li class="list-group-item">
  <%= link_to 'Job folder', cader_job_folder_path , class: '', title: '', data: {toggle: 'tooltip'} %>
</li>

Routes.rb为:

  namespace :cader do
    get '/caders/index', to: 'caders#index', as: 'index'
    get '/caders/available', to: 'caders#available_jobs', as: 'available_job'
    post '/caders/checkout/:id', to: 'caders#checkout_job', as: 'checkout_job'
    get '/caders/checkin/', to: 'caders#check_in_job', as: 'check_in_job'
    post '/caders/update_job/', to: 'caders#update_job', as: 'update_job'
    get '/caders/update_job/', to: 'caders#update_job'
    post '/caders/delete_job/', to: 'caders#delete_job', as: 'delete_job'
    get '/caders/submit_job', to: 'caders#submit_job', as: 'submit_job'
    post '/caders/create_order', to: 'caders#create_order', as: 'create_order'
    get '/caders/release_job', to: 'caders#release_job', as: 'release_job'
    post '/caders/submit_complete_job', to: 'caders#submit_complete_job', as: 'submit_complete_job'
    get '/caders/downloads', to: 'caders#downloads', as: 'downloads'
    get '/caders/history', to: 'caders#history', as: 'history'
    get '/caders/download_job', to: 'caders#download_job', as: 'download_job'
    get '/caders/job_folder', to: 'caders#job_folder', as: 'job_folder'

    get '/update', to: 'caders#update', as: 'update'
    get '/jobs/completed', to: 'jobs#completed', as: 'view_completed_jobs'
    get '/jobs/all', to: 'jobs#all', as: 'all_jobs'
    get '/jobs', to: 'jobs#index', as: 'jobs'
  end

控制台输出:

  cader_update_job POST       /cader/caders/update_job(.:format)                                                       cader/caders#update_job
                           cader_delete_job POST       /cader/caders/delete_job(.:format)                                                       cader/caders#delete_job
                         cader_create_order POST       /cader/caders/create_order(.:format)                                                     cader/caders#create_order
                  cader_submit_complete_job POST       /cader/caders/submit_complete_job(.:format)                                              cader/caders#submit_complete_job
                                cader_index GET        /cader/caders/index(.:format)                                                            cader/caders#index
                        cader_available_job GET        /cader/caders/available(.:format)                                                        cader/caders#available_jobs
                         cader_checkout_job POST       /cader/caders/checkout/:id(.:format)                                                     cader/caders#checkout_job
                         cader_check_in_job GET        /cader/caders/checkin(.:format)                                                          cader/caders#check_in_job
                    cader_caders_update_job GET        /cader/caders/update_job(.:format)                                                       cader/caders#update_job
                           cader_submit_job GET        /cader/caders/submit_job(.:format)                                                       cader/caders#submit_job
                          cader_release_job GET        /cader/caders/release_job(.:format)                                                      cader/caders#release_job
                            cader_downloads GET        /cader/caders/downloads(.:format)                                                        cader/caders#downloads
                              cader_history GET        /cader/caders/history(.:format)                                                          cader/caders#history
                         cader_download_job GET        /cader/caders/download_job(.:format)                                                     cader/caders#download_job
                           cader_job_folder GET        /cader/caders/job_folder(.:format)                                                       cader/caders#job_folder
                               cader_update GET        /cader/caders/update(.:format)                                                           cader/caders#update
                  cader_view_completed_jobs GET        /cader/caders/jobs/completed(.:format)                                                   cader/jobs#completed
                             cader_all_jobs GET        /cader/caders/jobs/all(.:format)   

但是,如果我单击链接,它将更改页面,但URL保持不变 如:http://localhost:3000/cader/caders/index 但是其他namescape的链接工作正常。 请建议我是否做错了什么
预先感谢

0 个答案:

没有答案