IIC2143-2021-1 / Syllabus

47 stars 13 forks source link

ActionController::RoutingError (No route matches [POST] "*"):. #113

Closed PDominguezW closed 3 years ago

PDominguezW commented 3 years ago

Al editar informaci贸n de una publicaci贸n, Rails imprime ActionController::RoutingError (No route matches [POST] "/publications/18/edit"):.

meretamal commented 3 years ago

Hola 馃榿 , puedes subir el contenido de tu archivo routes.rb?

PDominguezW commented 3 years ago
Rails.application.routes.draw do
  devise_for :users, controllers: { sessions: 'users/sessions', registrations: 'users/registrations' }, 
                     path: '', path_names: {sign_in: 'login', sign_out: 'logout', sign_up: 'register'}

  get 'publications/my_publications'
  get 'publications/:id/new_comment', to: 'comments#new'
  get 'publications/:id/comments', to: 'comments#index'

  resources :publications

  get 'comments/new'
  get 'comments/edit/:id', to: 'comments#edit', as: 'comments_edit'
  get 'comments/show'
  get 'comments/update', to: 'comments#update', as: 'comments_update'
  get 'comments/delete/:id', to: 'comments#destroy', as: 'comments_delete'

  post 'comments/new', to: 'comments#create'
  resources :comments

  root 'publications#index'

end
meretamal commented 3 years ago

Hola 馃榿 , me imagino que tu error est谩 en que se est谩 mandando el formulario con el m茅todo POSTen lugar en lugar de PUTo PATCH. Puedes mandar el contenido del form que usas para editar tu publicaci贸n?