【发布时间】:2018-02-06 06:40:24
【问题描述】:
在我的应用中路由时出现以下错误
路由错误
没有这样的页面:页面/联系人
该页面确实存在,我在 URL 中注意到它说:
http://localhost:3000/pages/pages/contact所以渲染双/pages/
Routes.rb
Rails.application.routes.draw do
get 'pages/index' => 'high_voltage/pages#show', id: 'index'
root :to => 'high_voltage/pages#show', id: 'index'
end
html.erb
<%= link_to 'pages/contact', :class => 'btn btn--sm btn--primary type--uppercase' do %>
请务必注意,如果我是从 index 路由 -> contact 很好,但是,如果我从另一个内部页面(例如 about 或 team)路由,它将在 URL 中双重呈现
TIA
【问题讨论】:
标签: ruby-on-rails high-voltage