Answer the question
In order to leave comments, you need to log in
How to remap model paths in Rails?
Hello, I have models, but Rails incorrectly defines the paths for them (i.e. you have to write form_for(@model, url: my_new_url_path) . So I would like to define this in the model one day and not write the url:
Is it possible to do this?
Answer the question
In order to leave comments, you need to log in
Usually, if a computer incorrectly determines something, then it is being used for other purposes. It is especially easy to make such a mistake in such a "conventional" environment as rails.
What do you mean it misidentifies?
Are you making a link like
/users/username instead of /users/id ?
Then there is the to_param method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question