@tomo_pongrac Thanks for the link, but I already have a working JQuery Autocomplete. My question is whether I can improve the way I redirect after selection by adding a "url" attribute to my object, like this website seems to do.
@tomo_pongrac Can you give me a hint on how I should generate the url in the controller? I've been trying to loop over the array, generate the url and add it back to the array, but it just looks silly and the worst part is that it doesn't work.
Does this look like a good solution?
What did you mean that I could store the url in the database? I think that I might prefer that solution but I can't think of a way to do it.
Thanks for getting back at me and... sorry for dragging it, but I'm really curious about how I could save such values in the database. I tried to save the url in migrations, but I didn't further than
in that solution you cant have default value because you dont know how url will look ... you can know id only when you create row in database so that can perform only on creating new restaurant, which you create, i guess, with form ... but know when i see how your url look method which you did is best solution ...