[Solved] ElegantRails – Multiple Routes to one Controller Action

Absolutely there is. You can use a parameter directly in your route. Even further, you can then use that parameter directly in your query, rather than using a case statement. #routes.rb get ‘suggestions/:type’, to: ‘suggestions#index’ # suggestions_controller.rb def index @suggestions = Suggestion.where(suggestion_type: params[:type]) end It’s always a better practice to base your controller actions after … Read more

[Solved] Cakephp routing (in PHP too) [closed]

As indicated in the docs, you can use regular expressions to restrict matching route elements. The regex snippet you are looking for is: ‘(?i:hellouser)’ Route definition Putting the docs and your specific regex together, here’s a route that will match the url /hellouser in a case insensitive manner: Router::connect( ‘/:user’, array(‘controller’ => ‘teachers’, ‘action’ => … Read more