title: How to change routes in ruby on rails?
body: <p>I just installed Ruby on Rails and created a scaffold called <code>posts</code>. RoR generated controllers and other required files for me.</p>
  
  <p>I created a new method in <code>posts_controller</code>, but I can't access it. I looked at other methods that are in the controller and looks like I need to access them by <code>/posts/[MY POST ID]/[MY METHOD NAME]</code>.</p>
  
  <p>Assuming I created my custom method <code>hello</code> in the controller, how do i access it?</p>
  
  <p>I looked at <code>routes.rb</code>, but there's no configuration for it.</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>I understand that I can manually configure it in <code>routes.rb</code>, but how do all the other methods work? For example, I have "<code>edit</code>", and "<code>update</code>" methods in the "<code>posts_controller.rb</code>" controller. How do those two methods work without configuring routes?</p>
  
  <pre><code>  # GET /posts/1/edit
    def edit
      @post = Post.find(params[:id])
    end
  </code></pre>
  
  <p>I can't find a configuration that matches <code>/posts/[0-9]/edit</code> pattern.</p>