app / views / participants / index.html.erbの内部:
<%= form_tag bulk_add_participants_program_path do %>
<%= wrap_control_group do %>
<%= text_area_tag :bulk_add_participants, :size => "60x3" %>
<% end %>
<%= submit_tag "Import Participants and Users" %>
<% end %>
ただし、コントローラーとルートはプログラムモデルに関連していることに注意してください(UIの理由から)。そして、それは問題に関係しているのではないかと思います。そのビューをレンダリングすると、次のエラーメッセージが表示されます。
No route matches {:action=>"bulk_add_participants", :controller=>"programs"}
app / controllers / programs_controller.rbにあるので、これは奇妙です。
def bulk_add_participants
puts "yay!" # because i am troubleshooting
end
そして私のconfig/Routes.rbは次のとおりです。
RepSurv::Application.routes.draw do
root to: 'programs#index'
devise_for :users, path_prefix: 'devise'
resources :users
resources :programs do
resources :participants do
resources :rounds do
get 'survey' => 'rounds#present_survey'
put 'survey' => 'rounds#store_survey'
end
end
resources :questions
resources :rounds
member do
get 'report' => 'reports#report'
get 'bulk_add_participants'
end
end
end