嵌套资源路由助手不起作用 [英] Nested resource route helper not working

查看:67
本文介绍了嵌套资源路由助手不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的嵌套路线:

  resources :apps do
    resources :issues
  end

查看与应用程序相关的所有问题的助手如下:

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

app_issues_url(app)

但是现在我想使用一个助手来指向特定应用程序的特定问题,例如apps / 1 / issues / 1,但我不知道如何使用该助手。

but now I want to use a helper to point to a specific issue of a specific app like apps/1/issues/1 but i don't know how to use that helper. what is the helper for this url?

推荐答案

您可以将两个实例都传递给url助手,例如

you can pass both instances to url helper like

app_issue_url(@app,@issue)

您还可以使用

app_issue_path(@app,@issue)

url_for([@app,@issue])

请参见跟踪文档以获取更多信息

这篇关于嵌套资源路由助手不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆