1
我剛剛安裝了Devise,現在我想爲Devise製作更好的風格。我在application.html.rb鏈接中添加了編輯Devise用戶配置文件,但是當我訪問此頁面然後返回到索引頁面時,我沒有路由匹配錯誤。在Ruby on Rails上設計路線3.2.1
HTML生成此鏈接爲家庭/索引:http://localhost:3000/assets?controller=devise%2Fhome
但真正需要的是:http://localhost:3000/home/index
有去參觀一些設計用戶頁面錯後。
我的導航:
<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>
的routes.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"
我已經改變了所有應用程序中我的導航鏈接路徑,而不是這種風格:控制器=>「家」,:動作=>「索引」,現在所有的工作! – RydelHouse