Route a form to new controller action in Ruby on Rails

前端 未结 3 1654
遥遥无期
遥遥无期 2021-01-25 17:23

I am relatively new to Ruby on Rails, and am trying to set up a form with a new action on an existing controller.

My existing model and controller is called \'projects\'

3条回答
  •  终归单人心
    2021-01-25 17:59

    You can change your route to something like

    match 'queue/:username' => 'projects#queue', :as => 'projects_queue'
    

    And then have the destination be

    projects_queue(current_user)
    

提交回复
热议问题