title: Converting map.js in Rails routes.rb to new Rails 3 DSL
body: <p>I am try to convert an older DSL style routes.rb file in a project I am working on to the new DSL style used in Rails 3. Since most of it consists of regular routes, the conversion seems simple. Most of it just goes like:</p>
  
  <pre><code>RailsRoot::Application.routes.draw do |map|
    root :to =&gt; "index#index"
    match '/table/create' =&gt; "table#create"
    match '/table/delete' =&gt; "table#delete"
  
    # A bunch more of similar match statements
  
    map.js ':controller/:action.:format'
  end
  </code></pre>
  
  <p>I've been following the documentation at <a href="http://blog.engineyard.com/2010/the-lowdown-on-routes-in-rails-3" rel="nofollow">engine yard</a> to do the conversion. If I am reading it right, it looks like to me I should be able to just remove the surrounding <code>draw do |map|</code> code and since under the new DSL, the <code>:to</code> tag seems to be assumed unless stated otherwise, the match statements should be able to be left as is and work. (However, I could be entirely wrong in my assumption and possibly have that be my main problem.)</p>
  
  <p>The issue I think I am having is when I get down to that line that says <code>map.js ':controller/:action.:format'</code>, I have no clue how to convert that for the Rails 3 style DSL for routing. How would I go about converting this?</p>
  
  <h3>Edit #1:</h3>
  
  <p>I just ran rake routes after converting it with Iuri G's comment suggestion, and it's actually complaining about <code>root</code> not being defined. So Iuri G probably gave me the correct solution, but I need to solve this other problem first before I can verify it.</p>
  
  <h3>Edit #2:</h3>
  
  <p>I am an idiot for not realizing this. Since all the example code I saw excluded this part, I thought I didn't need it anymore. However, what I was missing was this line:
  <code>RailsRoot::Application.routes.draw do</code>
  and then having the rest of the routes inside the block. I feel really silly right now. Anyways, Iuri G was right on the money. Thanks a bunch!</p>