Say I was building Github (I'm not!), I'd really just like to link_to @repo rather than every time having to specify link_to [@repo.owner, @repo]. That's not too much to ask is it?
--
You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
To post to this group, send email to rails-...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceani...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
https://github.com/benhoskings/hammock
It kinda worked (well, it totally worked, in a limited set of cases), but the problem is that there are a lot of assumptions hidden in there.
The problem is that context really starts to creep in -- there'll be some exception to the "always use /:user_id/:repo_name" rule (e.g. on Repo#update, etc) that an association-aware or nesting-aware route helper doesn't know about.
If it were me, I'd just use helpers like Dan suggested until I had 3 or 4 of them, and then try to extract something more involved. You never know, you might get away with just a couple of one-liners :)
- Ben
> --
> You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rails-oceania/-/nL91ta0AjSAJ.