Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6661983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:20:31+00:00 2026-05-26T02:20:31+00:00

I just recently started programming in Ruby on Rails, and I was wondering if

  • 0

I just recently started programming in Ruby on Rails, and I was wondering if some of you could look over my routes.rb file that I am using so far and tell me if I am over thinking this.

I am aware of the whole RESTful approach in RoR and I am trying to stick to it, but I am not sure if I am on track. So far my application only has the following functionality:

  • User registration
  • User activation (via email link)
  • User can request activation to be resent
  • User log in
  • User log out
  • User requests password reset (gets an email)
  • Basic UCP (change email and password)

I am using a lot of redirect_to *_url and *_path, so I want a lot of named routes. I am trying to explicitly declare only routes that are allowed. Thanks for your input.

MyApp::Application.routes.draw do
  get 'home' => 'pages#index', :as => 'home'
  get 'testing' => 'pages#testing', :as => 'testing'

  get 'register' => 'users#new', :as => 'register'
  post 'users/create'
  resources :users, :only => [
    :new,
    :create
  ]

  get 'activation' => 'activations#new', :as => 'activation'
  get 'activate/:token' => 'activations#activate', :as => 'activate'
  post 'activations/edit'
  resources :activations, :only => [
    :new,
    :activate,
    :edit
  ]

  get 'login' => 'sessions#new', :as => 'login'
  get 'logout' => 'sessions#destroy', :as => 'logout'
  get 'sessions/destroy'
  resources :sessions, :only => [
    :new,
    :create,
    :destroy
  ]

  get 'forgot_password' => 'resets#new', :as => 'forgot_password'
  post 'resets/create'
  get 'activate_password/:token' => 'resets#activate', :as => 'activate_password'
  put 'save_password' => 'resets#save', :as => 'save_password'
  resources :resets, :only => [
    :new,
    :create,
    :activate,
    :save
  ]

  get 'ucp' => 'ucp#show', :as => 'ucp'
  post 'ucp_update' => 'ucp#update', :as => 'ucp_update'
  resources :ucp, :only => [
    :show,
    :update
  ]

  root :to => 'pages#index'
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:20:31+00:00Added an answer on May 26, 2026 at 2:20 am

    When you use resources, it automatically makes named routes for you. I won’t go through your entire routes file, but one example:

      get 'activation' => 'activations#new', :as => 'activation'
      get 'activate/:token' => 'activations#activate', :as => 'activate'
      post 'activations/edit'
      resources :activations, :only => [
        :new,
        :activate,
        :edit
      ]
    

    Could be:

    resources :activations, :only => [:new, :edit] do
      get 'activate', :on => :member
    end
    

    which will produce new_activation_path, edit_activation_path, and activate_activation_path

    Go to the Rails Routing Guide for a lot of cool stuff you can do in routes. For example, if you want to use “register” instead of “new” for your Users paths:

     resources :users, :only => [:new, :create], :path_names => [:new => 'register']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just recently started with object oriented programming, using java. Before I was programming
I've just recently started programming for the iPhone and I'm making an application that
I have just recently started out programming for Android, and have decided that I
I just recently started diving into Real World Haskell and the book provides some
I recently started game programming on the iPhone using Cocos2d and Box2d. So here's
I just started programming with objects recently and am trying to learn good habits
I just recently started using this library (the one from CodePlex), but I ran
I just recently started learning RoR and found that Prototype.js is a default javascript
I have recently started learning Ruby, as my first programming language. I feel comfortable
I have recently started programming for the iOS Platform but now I need some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.