Best practices to handle routes for STI subclasses in rails

后端 未结 18 1309
面向向阳花
面向向阳花 2020-11-30 16:25

My Rails views and controllers are littered with redirect_to, link_to, and form_for method calls. Sometimes link_to and <

18条回答
  •  星月不相逢
    2020-11-30 17:09

    Use type in the routes:

    resources :employee, controller: 'person', type: 'Employee' 
    

    http://samurails.com/tutorial/single-table-inheritance-with-rails-4-part-2/

提交回复
热议问题