我正在尝试为博客文章作者创建一个描述页面。我创建了一条路线:
mount Monologue::Engine, at: '/blog'
#create routes for monologue
Monologue::Engine.routes.draw do
get 'p/:name', to: 'authors#show', as: :author
end
我在 app/controllers/monologue 中创建了一个控制器:
class Monologue::AuthorsController
def show
puts "in show method"
end
end
我不断收到此错误:
undefined method `action' for Monologue::AuthorsController:Class
长话短说:如何在独白中生成控制器?