0

I am using rails 3, Ubuntu 10.04 and Ruby 1.8.7.

link_to "name", lettings_path(lettings)

is producing a link: /lettings.id and not /lettings/id as I would have expected.

in my routes.rb file I have:

resources :lettings

My model name is Letting.

This has me completely stumped, never in 6 years have I come across this - I would really appreciate any ideas you guys might have.

1 Answer 1

1

That's strange. The lettings variable you use - is it an instance of Letting or an array of lettings?

Btw, do you know that in rails 3 you don't need to use the letting_path helper? Just do it like that:

= link_to "name", letting
Sign up to request clarification or add additional context in comments.

1 Comment

letting is an instance in a partial which is called using a collection of lettings. Interestingly using the "link_to" you suggested solved the problem.... That is very odd. Thanks for the help :-)

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.