To clean up my code I would like access to the RESTful helpers in my Rails model. Something like:
users_path
etc.
Thanks.
To clean up my code I would like access to the RESTful helpers in my Rails model. Something like:
users_path
etc.
Thanks.
Why do you want to access routes in your model? This is a violation of the Model/View/Controller (MVC) pattern that is at the heart of Rails. Models shouldn't have any knowledge of routes which are a controller and view concern. Models should stand alone from the user interface.
If you told us what you are trying to achieve then we may be able to suggest a better approach.