如果在views/abouts/中,我有“index.html.haml”和“history.html.haml”。
如何访问 abouts#history 这是一个基本的 html 页面。
从日志中我得到这个错误,我猜它正在处理它作为一个节目,我该怎么办?:
Processing by AboutsController#show as HTML
Parameters: {"id"=>"history"}
About Load (0.3ms) SELECT `abouts`.* FROM `abouts` WHERE (`abouts`.`id` = 0) LIMIT 1
ActiveRecord::RecordNotFound (Couldn't find About with ID=history):
路线.rb
scope() do
resources :abouts, :path => 'about-us' do
match 'about-us/history' => "about-us#history"
end
end
abouts_controller.rb
def history
respond_to do |format|
format.html
end
end