3 ms·
Rails has GET variables, but the "rails way" is "restful routes" whenever possible. So something like /posts/12 will automatically pass 12 as a specific GET var
by bricestacey 16y ago
Rails has GET variables, but the "rails way" is "restful routes" whenever possible. So something like /posts/12 will automatically pass 12 as a specific GET variable e.g. params[:id]. Or /posts/12/comments/4 might pass the parameters :id (12) and :comment_id (4).
This happens all the time for people using PHP too, however it's usually accomplished via mod_rewrite. For example, Drupal's pretty URLs simply rewrite /posts/12/comments/4 to /index.php?q=posts/12/comments/4.