You’re not receiving notifications from this thread.
How do I pass an id to a foreign controller?
A very basic question I know, but I'm really struggling. If I use a link_to with the current controller's path then I get the id as a parameter but if I instead use a path to a different controller then I get a format instead.
So from the same view I get the following paths generated by the team show view:
team/2/add/ and player/add.2
Can you post your routes and the
link_to you're using?
Hi Mark, I'm with Jacob. If you could show the code that would be great.
Also, what are you trying to do? Do you have a single page with multiple objects executing different types of CRUD functionality? If thats the case then perhaps you should use a view object that is a single model that represents all the models on that page. That way you can maintain RESTful routes and not have to try and share object id's accross controllers.
I'm sure Chris has some content around executing this kind of strategy. If not, I'm happy to share some additional context if need be.