Migrating from Drupal to Rails - Routing -
I have developed a new ruby on the rail site for my organization. I want the new railway site Should be stopped, which were created for the old site and display a message to the user, indicating that the new site has been launched, there is a new URL link which they were trying to get the most, and a reminder Update Bookmarks
So I Ray I of color when they come to train I'm asking how you will do. Is there a railway route?
These are my thoughts so far.
The old site does not use a clean URL, so every request goes to the default route, in the new site that the controller with a query string was thinking in the controller that I I can check if the parameters [: q]
is set and then depending on what the q parameter is, it is up to the user to search and submit an information page to give new instructions contact. If the q parameter does not mean (I do not care about catching every page on the old site, only important people are) redirecting to the custom 404 page, the user is informed that the link was probably for the old site, and give it Given user a search page
Any ideas, is there a better way?
I appreciate any input.
Thank you
Responsible for the homepage in your Rail Controller (assuming that Home Controller) Add Falter beforehand:
Class Home Controller & lt; ActionController :: Prior to Base_Filters: handle_drupal_requests ,: only = & gt; :
Then add the handler method itself as handle_drupal_requests
.
Classroom HomeController & lt; ActionController :: Prior to Base_Filters: handle_drupal_requests ,: only = & gt; : Index # ... other code ... private def handle handle_druple_recase if paramon [: Q]. Display? Flash [: Notice] = "You are being redirected to Blah." Redirect_to convert_drupal_url (param [: q]),: position => For example: item, id = query_string.split ('& amp;') last.split ('=') item_controller = item.underscore.split ('your argument to change the query string for) 301 end end def Convert_drawpal_url (query_string) _ '). First.pluralize {: Controller = & gt; Item_controller ,: action = & gt; "Show",: id = & gt; Id} end and
Comments
Post a Comment