Convert post_id to category/post?

(PJH) #1

Messing around in sidekiq and saw this:


They all seem to relate to the same post so wanted to have a poke to see what was wrong - but how can I locate a post given only its post_id (without digging out an archive and searching through that, that is)

(Jeff Atwood) #2

Not sure – do we have a route that will navigate to a post_id @riking? That might be handy to have, if it does not already exist.

(Kane York) #3

We happen to have this, which is not mentioned or generated anywhere, but counts as a shared link tries and fails to count as a shared link:

get "p/:post_id/:user_id" => "posts#short_link"

I think I’ll make a PR to make that a little bit better.

(Jeff Atwood) #4

Didn’t your PR for a better URL go in here?

(Kane York) #5

Yes, I seem to remember you pulling it… :stuck_out_tongue:

It didn’t actually add a better URL (was going to add /posts/id), just made the user_id optional and actually work.

(Jeff Atwood) #6

Ok let’s see post deploy

Yep looks good!

(Jeff Atwood) #7