有关向您展示如何创建博客的指南,我已获得5.7。本节将告诉您如何显示文章,但在执行以下步骤后,我只会在尝试运行rails server时发生错误。它确切地说它是一个路线行中的语法错误。该行是“article get /articles/:id(.:format)articles#show”,错误指向:id。我不知道该怎么做,我已经看过指南的路线部分,我认为这是一条有效的路线。Ruby on rails指南
routes.rb
包含
Rails.application.routes.draw do
get 'welcome/index'
resources :articles
root 'welcome#index'
article get /articles/:id(.:format) articles#show
end
我收到确切消息时,我使用的命令轨道服务器:
blog/config/routes.rb:5: syntax error, unexpected ':', expecting keyword_end (SyntaxError) article get /articles/:id(.:format) article#show
添加出现在控制台中的错误和文章中的show.html.erb文件。 –
请发布您的'routes.rb'文件 – jdgray