我有兩個文件叫做list.html.erb
和register.html.erb
。如何獲得鏈接標籤的工作?
我點擊了鏈接
<%= link_to 'Lists',posts_list_path %>
,但我沒有得到任何迴應。點擊鏈接後,我預計會去list.html.erb
頁面。
的routes.rb:
resources :posts
post '/posts/list',:controller=>'posts',:action=>'list'
post '/posts/register',:controller=>'posts',:action=>'register'
register.html.erb:
<h1>Welcome#index</h1>
<%= link_to 'Lists',posts_list_path %>
Started GET "/posts/list" for 127.0.0.1 at 2014-03-20 00:08:27 +0530
Processing by PostsController#show as HTML Parameters: {"id"=>"list"}
Rendered posts/register.html.erb within layouts/application (1.0ms)
Completed 200 OK in 106ms (Views: 88.0ms | ActiveRecord: 0.0ms) [2014-03-20 00:08:27]
WARN Could not determine content-length of response body.
Set content-length of the response or set Response#chunked = true
檢查你的日誌。是否調用了正確的操作?你看到任何錯誤?你的行動輸出了什麼?除非您給我們提供更多信息,否則我們無法幫助您。 – meagar
爲什麼你編輯你的問題? –
我沒有得到list.html.erb page.i得到了相同的頁面(register.html.erb) – user3279260