1

I'm trying to construct a Link. The resulting Link should look something like this:

http://localhost:3000/re_goal/edit/2

This is what I came up with:

<%= @issue.re_artifact_properties.collect { |properties| link_to properties.name, re_goal_path()}.to_sentence %>

It now says that i may have ambiguous routes.

content_url has the following required parameters: ["projects", :project_id, "re_goal", :id]

But if i pass the project_id as an option, the constructed link looks something like this:

http://localhost:3000/projects/1/re_goal/1

Does any1 has an idea on how to construct the correct link?

Thanks,

Nico

0

2 Answers 2

2

Looks like you've got a nested route being generated there. Either supply the required params, or remove the nested route.

Or go for the 'middle way' of shallow routes:

resources :projects, :shallow => true do 
  resources :re_goal
end
Sign up to request clarification or add additional context in comments.

1 Comment

thanks. this wasnt exactly the solution but your hint was enough for me to find it :)
0

If you have a route that takes parameters, you must supply them. rake routes can be useful for determining what arguments are required and what order they should be provided in. Your route probably looks like this:

projects/:project_id/re_goal/:id

In this case you will need to provide project_id and id as the two arguments to re_goal_path. If you omit them you get the "required parameters" error. It's not clear from your question how you get a project or a goal from your @issue, but that's what you need.

1 Comment

my goals look like this: pastie.org/private/sokt19xecb4sseujqb1hca the problem is that he seems to require arguments he shouldnt need. i just want goal/1/edit not projects/1/goal/1/edit, nevertheless he wants me to pass the project id. the problem is not getting the required project id, this is saved directly in the issues object

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.