title: Adding a webpage in rails for model
body: <p>I need to add a graph page such that when 'listing/id/graph' is clicked, the graph page of listing id is rendered. This graph page contains analytics of that listing id.</p>
  
  <p>I tried the following:</p>
  
  <p>adding in routes.rb
                  <code>get 'graphs' =&gt; "listings#id#graphs"</code></p>
  
  <pre><code>listings controller 
   def graphs
      @listing = Listing.find(params[:id])
    end
  as same as 
  def show
             @listing = Listing.find(params[:id])
   end
  </code></pre>
  
  <p>Current result: No route matches [GET] "/listings/2/graphs"</p>
  
  <p>Expected result: render graphs.html.erb</p>
  
  <p>Rake routes <a href="https://i.stack.imgur.com/Gieat.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gieat.png" alt="rake routes"></a></p>
  
  <p>I'm pretty new to Ruby-on-Rails. Thanks in advance.</p>