[RUBY] How to identify the path that is easy to make a mistake

How to identify the path

When searching for a path name, I usually use rails routes at the terminal,

               Prefix Verb   URI Pattern                                                                              Controller#Action
    new_admin_session GET    /admins/sign_in(.:format)                                                                admins/sessions#new
        admin_session POST   /admins/sign_in(.:format)                                                                admins/sessions#create
destroy_admin_session DELETE /admins/sign_out(.:format)                                                               admins/sessions#destroy

Find the path name from the prefix.

no path name

However, there are cases where the path name is not written like this.

               Prefix Verb   URI Pattern                                                                              
         edit_product GET    /products/:id/edit(.:format)                                                             products#edit
              product GET    /products/:id(.:format)                                                                  products#show
                      PATCH  /products/:id(.:format)                                                                  products#update
                      PUT    /products/:id(.:format)                                                                  products#update
                      DELETE /products/:id(.:format)                                                                  products#destroy
                 cart GET    /carts/:id(.:format)                                                                     carts#show

The path name for products # destroy and products # update cannot be found. In this case, the path name will be product_path. You can go up until the path name appears in the prefix.

Recommended Posts

How to identify the path that is easy to make a mistake
How to make a mod for Slay the Spire
How to make a JDBC driver
How to make a splash screen
How to make a Jenkins plugin
How to make a Maven project
How to make a Java array
A good way to make a recursive function that reverses the characters
Let's write a code that is easy to maintain (Part 2) Name
How to make a Java calendar Summary
The story of making a binding for libui, a GUI library for Ruby that is easy to install
How to make a Discord bot (Java)
How to interact with a server that does not crash the app
A program that determines whether the entered integer is close to an integer
JVM Performance Tuning: What is Tuning and How to Make a Good Plan
How to get the absolute path of a directory running in Java
Write code that is easy to maintain (Part 1)
How to create a class that inherits class information
How to make a lightweight JRE for distribution
Write code that is easy to maintain (Part 4)
How to make a follow function in Rails
Write code that is easy to maintain (Part 3)
If it is Ruby, it is efficient to make it a method and stock the processing.
Find a value that is convenient to have a method and make it a ValueObject
How to make a unique combination of data in the rails intermediate table
I tried to make a program that searches for the target class from the process that is overloaded with Java
[Ruby] I want to make a program that displays today's day of the week!
How to make a factory with a model with polymorphic association
How far is the correct answer to divide the process?
How to make a Vagrant Plugin that you learned when you forked and published vagrant-mutagen
How to make JavaScript work on a specific page
MockMVC returns 200 even if I make a request to a path that does not exist
How to make shaded-jar
How to specify the resource path in HTML import
How to make a cache without thinking too much
How to fix the problem that the upper half is cut off when using UITabBar
How to identify the cause when GC occurs frequently and CPU usage is high
How to perform a specific process when the back button is pressed in Android Fragment
A memo of the program that allows you to realize that the probability of dice rolling is about 1/6
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
[Java] I tried to make a rock-paper-scissors game that beginners can run on the console.
[Docker] Is it good enough to call it a multi-stage build? → The story that became so good
How to take a screenshot with the Android Studio emulator
SDWebImage: How to clear the cache for a particular UIImageView
Determine that the value is a multiple of 〇 in Ruby
How to create a form to select a date from the calendar
How to create a placeholder part to use in the IN clause
[Ruby] How to retrieve the contents of a double hash
How to add the same Indexes in a nested array
What is an immutable object? [Explanation of how to make]
[jsoup] How to get the full amount of a document
[Rails] How to temporarily save the request URL of a user who is not logged in and return to that URL after logging in
Java --How to make JTable
How to leave a comment
[Rails] How to make seed
How to insert a video
How to create a method
How to make Ubuntu a fixed IP address on the command line (explained as carefully as possible)
How to make an application with ruby on rails (assuming that the environment has been built)
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
How to build an environment with Docker, which is the minimum required to start a Rails application