"没有路线匹配[PATCH]" / authors / posts"

时间:2018-02-01 03:32:08

标签: ruby-on-rails routes

在对帖子进行编辑后点击更新按钮时,我得到了

从Chrome浏览器

"No route matches [PATCH] "/authors/posts"

从命令行

  

" ActionController :: RoutingError(没有路由匹配[PATCH]" / authors / posts"):"

这是Routes文件

Rails.application.routes.draw do

  devise_for :authors
  root to: 'blog/posts#index'
  # /author/posts
  namespace :authors do
    resources :posts
  end

  scope module: 'blog' do
    get 'about' => 'pages#about', as: :about
    get 'contact' => 'pages#contact', as: :contact
    get 'posts' => 'posts#index', as: :posts
    get 'posts/:id' => 'posts#show', as: :post
  end
  end

这是edit.html.erb文件:

<% provide(:page_title, "Edit #{@post.title}") %>
<% provide(:author, 'active') %>
<h1>Editing Post</h1>

<%= render 'form', post: @post, url: authors_post_url(@post) %>



<%= link_to 'Show', @post %> |
<%= link_to 'Back', authors_post_path %>

1 个答案:

答案 0 :(得分:0)

看起来您的for index, row in enumerate(lst): value = sheet.cell(row, 0).value columnA = int(float(index)/5)+1 模型嵌套在posts模型中,所以不应该像您的路线一样

authors