Nested resource route helper not working

前端 未结 1 2028
Happy的楠姐
Happy的楠姐 2020-12-16 16:48

I have a nested route like so:

  resources :apps do
    resources :issues
  end

the helper for seeing all issues related to an app is as fo

1条回答
  •  不思量自难忘°
    2020-12-16 17:22

    you can pass both instances to url helper like

    app_issue_url(@app,@issue)
    

    you can also use

    app_issue_path(@app,@issue)
    

    or

    url_for([@app,@issue])
    

    see rails doc for more info

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