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

  • Home
  • SEARCH
  • 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 8260183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:02:28+00:00 2026-06-08T03:02:28+00:00

In the routing guide it says that a single entry in the routing file,

  • 0

In the routing guide it says that “a single entry in the routing file, such as resources :photos creates seven eight different routes in your application, all mapping to the Photos controller:“.

    photos GET    /photos(.:format)          photos#index
           POST   /photos(.:format)          photos#create
 new_photo GET    /photos/new(.:format)      photos#new
edit_photo GET    /photos/:id/edit(.:format) photos#edit
     photo GET    /photos/:id(.:format)      photos#show
           PATCH  /photos/:id(.:format)      photos#update
           PUT    /photos/:id(.:format)      photos#update
           DELETE /photos/:id(.:format)      photos#destroy

How to create the equivalent routes using match and the verb methods (get, post, patch, put, delete)?

  • 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-06-08T03:02:30+00:00Added an answer on June 8, 2026 at 3:02 am
    match '/photos'          => 'photos#index',   via: :get
    match '/photos'          => 'photos#create',  via: :post
    match '/photos/new'      => 'photos#new',     via: :get, as: 'new_photo'
    match '/photos/:id/edit' => 'photos#edit',    via: :get, as: 'edit_photo'
    match '/photos/:id'      => 'photos#show',    via: :get, as: 'photo'
    match '/photos/:id'      => 'photos#update',  via: :patch
    match '/photos/:id'      => 'photos#update',  via: :put
    match '/photos/:id'      => 'photos#destroy', via: :delete
    

    and

    get    '/photos',          to: 'photos#index'
    post   '/photos',          to: 'photos#create'
    get    '/photos/new',      to: 'photos#new',  as: 'new_photo'
    get    '/photos/:id/edit', to: 'photos#edit', as: 'edit_photo'
    get    '/photos/:id',      to: 'photos#show', as: 'photo'
    patch  '/photos/:id',      to: 'photos#update'
    put    '/photos/:id',      to: 'photos#update'
    delete '/photos/:id',      to: 'photos#destroy'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i went through the default routes created by resources :photos over here : http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
I have my own routing rules in routes.php, defined for all the pages that
I am following this routing tutorial for Ruby on Rails: http://guides.rubyonrails.org/routing.html It says that
in routing.yml I can ressource other routing configs with: AcmeTestBundle: resource: @AcmeTestBundle/Resources/config/routing.xml prefix: /
My url routing is working properly inside Areas folder, that means i can go
I have a custom routing application that takes information for a route from google
In rails, on can show the active routes with rake ( http://guides.rubyonrails.org/routing.html ): $
I have this in my routes.rb scope '/admin' do root :to => 'home#index' resources
I have this routing setup at the moment routes.MapRoute( OldPages, // Route name page{id}.html,
I've managed to get my routes set up (with help from these questions Routing

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.