On May 21, 2:08 am, “Ryan B. (Radar)” [email protected]
You could use restful routing.
Well, I had a view on that restful routing thing and found that I
can’t use it, it breaks some
of the functionality.
I had a special action in my rails application that gets the
caller’s :controller, :action, and :id to enable
returning to the page where it came from. This was easy since
redirect_to would take variables as
I do not see how this would work with restful routing, since it
defines fixed macros for the pathes.
Who decided to use restful routing with rails?
To your first question, you should have a route in your routes.rb that
That is how you want it to stay compatible with your old rails app.
Restful routes look more like:
Where optional action is not a basic CRUD operation (new, edit, promote,
rate, etc.) So make sure your defined routes are the right format.
Now to keep track of where a user was, you dont need to
controller/action/id. You can capture the URI of the request. In your
controller, you can do
session[:return_to] = request.request_uri
So rather than controllers and actions, you simply capture the string
url path, and it works great with redirect_to.