url_for([:new, :project])
Will do the trick.
Question
$ url_for [Project]
=> projects_url
$ url_for [:new, Project]
=> new_projects_url
$ url_for [:new, Project, :test]
=> new_project_test_url
$ url_for [:new, Project, nil]
=> new_projects_url
I find url_for [:new, Project, :test]
especially interesting: here project
is singular!
Anyone has an idea how to generate a new_project_url
(or path) from an array like [:new, Project]
?
Solution
url_for([:new, :project])
Will do the trick.
OTHER TIPS
When using [:new, Project]
, :new
is a namespace.