Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested resource route helper not working

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 follows:

app_issues_url(app)

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?

like image 436
Matthew Berman Avatar asked Nov 21 '11 05:11

Matthew Berman


1 Answers

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

like image 61
Naren Sisodiya Avatar answered Oct 26 '22 23:10

Naren Sisodiya