rails prefix url

Hello rails!

I have a question for you and maybe I will get some help :slight_smile:

I want to prefix my url routes at the end of the url

example:

www.example.com/rails/_rb

or

www.example.com/foo/bar/_br

Any idea?

thx!

Hello,

So nobody has any clue how to solved this? :slight_smile:

So nobody has any clue how to solved this? :slight_smile:

Maybe nobody understands what you want to do --

I want to prefix my url routes at the end of the url

"prefix" and "at the end" are mutually exclusive.

Perhaps if you gave an example that explicitly shows the "normal"
url *and* the desired url to compare...

Hello,

thx for reply

example

localhost:3000/posts/amazing-post

I want to be: localhost/amazing-post/_post

localhost:3000/cities/berlin

I want to be: localhost:3000/berlin/_city

best

So if that's the desired result, what is the problem? You can manually
create whatever arbitrary URLs you like.

That said, I think you'll regret fighting Rails conventions this way :slight_smile:

Good luck!

Hello,

thx for reply

example

localhost:3000/posts/amazing-post
I want to be: localhost/amazing-post/_post
localhost:3000/cities/berlin
I want to be: localhost:3000/berlin/_city

Have a look at the Rails Guide on routing and you will see how to use
any route you desire to invoke the appropriate controller#action. Why
on earth you would want to do what you describe is a mystery to me
however.

Colin