Tag Archives: routes

How to Use Pretty URLs with Rails will_paginate Plugin

The will_paginate plugin for Rails uses a key/value assignment like ?page=2, rather than the pretty url formats such as /page/2 … This is because url generation and mapping are handled by the routes.rb file. You’ll need to modify the file so that rails knows what to do with request that match the pattern. Make sure [...]
Posted in Ruby on Rails | Also tagged , | 2 Comments

Namespacing in Rails

With namespace routes in Rails you can easily create a prefix for select resources. For instance, if you have an admin area or an account dashboard you can give logged in users access to methods that are not otherwise available. To use namespaces define them in config/routes.rb. *Note: this is available for the latest release [...]
Posted in Ruby on Rails | Also tagged , , | Leave a comment