The*_*end 3 routes ruby-on-rails
这让我很难过,做了一个新的控制器
class ScorecardsReviewController < ApplicationController
before_filter :require_staff_user
layout 'unbranded'
def index
@scorecards = Scorecard.in_review
end
end
Run Code Online (Sandbox Code Playgroud)
将此添加到路线中
resources :scorecards_review
Run Code Online (Sandbox Code Playgroud)
在主页上添加了一个链接
.left
= link_to 'Home', root_path
= link_to 'About', about_home_path
= link_to 'Legal', disclaimer_home_path
.right
- if current_user.try(:admin?)
= link_to 'Agencies', agencies_path
= link_to 'Inaccurate scorecards', reported_scorecards_path
= link_to 'Reviews', scorecards_review_path
- if current_user
= link_to 'Logout', logout_path
.clear
Run Code Online (Sandbox Code Playgroud)
刷新了应用程序,我得到以下内容
No route matches {:action=>"show", :controller=>"scorecards_review"}
Run Code Online (Sandbox Code Playgroud)
当我耙资产然后我发现一切都在那里
POST /scorecards_review(.:format) {:action=>"create", :controller=>"scorecards_review"}
new_scorecards_review GET /scorecards_review/new(.:format) {:action=>"new", :controller=>"scorecards_review"}
edit_scorecards_review GET /scorecards_review/:id/edit(.:format) {:action=>"edit", :controller=>"scorecards_review"}
scorecards_review GET /scorecards_review/:id(.:format) {:action=>"show", :controller=>"scorecards_review"}
PUT /scorecards_review/:id(.:format) {:action=>"update", :controller=>"scorecards_review"}
DELETE /scorecards_review/:id(.:format) {:action=>"destroy", :controller=>"scorecards_review"}
Run Code Online (Sandbox Code Playgroud)
我不知道它会是什么?
| 归档时间: |
|
| 查看次数: |
4517 次 |
| 最近记录: |