link_to リンクを使用して登録コントローラーに投稿しようとしています。
私は持っている<%= link_to "Register for Period", registration_path(period_id: period.id), :method => :post %>
次のようなリンクが生成されますhttp://localhost:3000/registrations/6?period_id=25
。6 は event_id です。period_id と user_id を登録データベースに保存する必要があります。
ブラウザに次のエラーが表示されます。No route matches [POST] "/registrations/6"
私は何を間違っていますか?
ルート:
Mavens::Application.routes.draw do
devise_for :users
resources :events
resources :periods
resources :products
resources :cart_rows
resources :product_requests
resources :inqueries
resources :registrations
match '/profile', to: 'static_pages#profile'
root :to => 'static_pages#home'
get "static_pages/home"
get "static_pages/about"
end