Rails render route path

后端 未结 1 1167
清酒与你
清酒与你 2021-01-24 20:48

Im still new to Rails and have a hard time understanding how the path system works in Rails.

In my routes.rb i create an alias for signup:

match \'signup         


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-24 21:11

    Try adding the ":as" to you route like this:

    match 'signup' => 'user#new', :as => :signup
    

    and then do

    redirect_to signup_url
    

    in your controller.

    That worked for me. I still don't know why. Maybe someone else has an explanation.

    0 讨论(0)
提交回复
热议问题