Я получаю эту ошибку маршрутизации
Не найдено ни одного маршрута {: controller => "posts",: action => "show"}
когда я нажимаю на ссылку новой записи со страницы индекса, она выдает мне эту ошибку, хотя в моей новой ссылке на публикацию я запрашиваю новое действие, я не знаю, вызывает ли она действие show.
моя индексная страница:
%h1 All Posts
%html
%head
%body
%table
%tr
%th Author Name
%th Title
%th Email
%th description
%th
%th
%th
- @posts.each do |post|
%tr
%td= post.author_name
%td= post.title
%td= post.email
%td= post.description
%td= link_to 'Show', post
%td= link_to 'Edit', edit_post_path(post)
%td= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete
%br
= link_to 'New Post', :controller => "posts", :action => "new"
моя страница редактирования:
%h1 Update Post
%html
%head
%title
%body
= form_for(@post) do |f|
= f.label :Author_name
%br
= f.text_field :author_name
%br
= f.label :Title
%br
= f.text_field :title
%br
= f.label :Email
%br
= f.text_field :email
%br
= f.label :Description
%br
= f.text_area :description
%br
= f.submit
%br
= link_to 'Back', post_path
мои рейковые маршруты:
new_auth_session GET /auths/sign_in(.:format) devise/sessions#new
auth_session POST /auths/sign_in(.:format) devise/sessions#create
destroy_auth_session DELETE /auths/sign_out(.:format) devise/sessions#destroy
auth_password POST /auths/password(.:format) devise/passwords#create
new_auth_password GET /auths/password/new(.:format) devise/passwords#new
edit_auth_password GET /auths/password/edit(.:format) devise/passwords#edit
PUT /auths/password(.:format) devise/passwords#update
cancel_auth_registration GET /auths/cancel(.:format) devise/registrations#cancel
auth_registration POST /auths(.:format) devise/registrations#create
new_auth_registration GET /auths/sign_up(.:format) devise/registrations#new
edit_auth_registration GET /auths/edit(.:format) devise/registrations#edit
PUT /auths(.:format) devise/registrations#update
DELETE /auths(.:format) devise/registrations#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
post_comments GET /posts/:post_id/comments(.:format) comments#index
POST /posts/:post_id/comments(.:format) comments#create
new_post_comment GET /posts/:post_id/comments/new(.:format) comments#new
edit_post_comment GET /posts/:post_id/comments/:id/edit(.:format) comments#edit
post_comment GET /posts/:post_id/comments/:id(.:format) comments#show
PUT /posts/:post_id/comments/:id(.:format) comments#update
DELETE /posts/:post_id/comments/:id(.:format) comments#destroy
posts GET /posts(.:format) posts#index
POST /posts(.:format) posts#create
new_post GET /posts/new(.:format) posts#new
edit_post GET /posts/:id/edit(.:format) posts#edit
post GET /posts/:id(.:format) posts#show
PUT /posts/:id(.:format) posts#update
DELETE /posts/:id(.:format) posts#destroy
root / posts#index
Я не могу понять, почему он ищет действие «показывает», когда я передаю его новым.