我刚刚安装了 Devise,现在我想为 Devise 制作更好的风格。我在 application.html.rb 链接中添加了编辑设计用户配置文件,但是当我访问此页面然后返回例如索引页面时,我没有路由匹配错误。
HTML 为 home/index 生成此链接:http://localhost:3000/assets?controller=devise%2Fhome
但确实需要:http://localhost:3000/home/index
访问 Devise 用户页面后出现问题。
我的导航:
<ul>
<li>
<h2>Izvēlne</h2>
<ul>
<li><a class="menu"><%= link_to "Jaunumi" ,:controller=>"home", :action => "index" %></a></li>
<li><a class="menu"><%= link_to "Par skolu" ,:controller=>"home", :action => "par_skolu" %></a></li>
<li><a class="menu"><%= link_to "Galerijas" ,:controller=>"home", :action => "galerijas" %></a></li>
<li><a class="menu"><%= link_to "Skolotāji" ,:controller=>"home", :action => "personals" %></a></li>
<li><a class="menu"><%= link_to "Kontaktinformācija" ,:controller=>"home", :action => "kontakti" %></a></li>
<li><a class="menu"><%= link_to "Personāla pieeja" ,:controller=>"home", :action => "pers_pieeja" %></a></li>
</ul>
</li>
<li>
<h2>Administrācija</h2>
<ul>
<li><%= link_to "Lietotāju rediģēšana", edit_user_registration_path %></li>
<li><%= link_to "Rakstu rediģēšana" ,:controller=>"posts", :action => "index" %></li>
<li><%= link_to "Galeriju rediģēšana" ,:controller=>"admin", :action => "galeriju_red" %></li>
</ul>
</li>
</ul>
路线.rb:
devise_for :users
get "admin/galeriju_red"
resources :posts
get "admin/rakstu_red"
get "home/par_skolu"
get "home/personals"
get "home/kontakti"
get "home/pers_pieeja"
get "home/galerijas"
get "home/index"