title: ActionController::RoutingError(Uninitialized constant AdminsController)
body: <p>I am using Rails 3 with <code>dhtmlxGrid</code>. I have created a controller called <code>admin</code> in that we defined 3 functions, such as <code>view</code>,<code>data</code>,<code>dbaction</code> and their view files.</p>
  
  <p>Below there is my <code>admin</code> controller file.</p>
  
  <pre><code> class AdminController &lt; ApplicationController
  
   def view
  
   end
  
   def data
  
   @users = User.all()
  
   end
  
  def dbaction
      #called for all db actions
  
      first_name = params["c0"]
      last_name    = params["c1"]
      phone            = params["c2"]
  
      @mode = params["!nativeeditor_status"]
  
      @id = params["gr_id"]
      case @mode
          when "inserted"
              user = User.new
              user.first_name = first_name
              user.last_name = last_name
              user.phone = phone
              user.save!
  
              @tid = user.id
          when "deleted"
              user=User.find(@id)
              user.destroy
  
              @tid = @id
          when "updated"
              user=User.find(@id)
              user.first_name = first_name
              user.last_name = last_name
              user.phone = phone
              user.save!
  
              @tid = @id
      end 
   end 
  end
  </code></pre>
  
  <p>Below is my view.rhtml file.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script src="/javascripts/codebase/dhtmlxcommon.js" type="text/javascript"       charset="utf-8"&gt;&lt;/script&gt;
      &lt;script src="/javascripts/codebase/dhtmlxgrid.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
      &lt;script src="/javascripts/codebase/dhtmlxgridcell.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  
      &lt;link rel="stylesheet" href="/javascripts/codebase/dhtmlxgrid.css" type="text/css" media="screen" charset="utf-8"&gt;
      &lt;link rel="stylesheet" href="/javascripts/codebase/skins/dhtmlxgrid_dhx_skyblue.css" type="text/css" media="screen" charset="utf-8"&gt;
      &lt;script src="/javascripts/codebase/dhtmlxdataprocessor.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="grid_here" style="width:600px; height:400px;"&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript" charset="utf-8"&gt;
          var grid = new dhtmlXGridObject("grid_here");
          grid.setImagePath("/javascripts/codebase/imgs/");
          grid.setHeader("First name, Last name, Phone");
          grid.setInitWidths("100,100,*");
          grid.setSkin("dhx_skyblue");
          grid.init();
          grid.load("/admin/data.xml");
  
          db = new dataProcessor("/admin/dbaction.xml");
  
          db.init(grid);
      &lt;/script&gt;
  
  
     &lt;input type="button" value="Add" onclick="grid.addRow(grid.uid(),'new user')"&gt;
      &lt;input type="button" value="Delete" onclick="grid.deleteSelectedRows()"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Below is my data.rxml file.</p>
  
  <pre><code>xml.instruct! :xml, :version=&gt;"1.0" 
  
  xml.tag!("rows") do
    @users.each do |user|
      xml.tag!("row",{ "id" =&gt; user.id }) do
          xml.tag!("cell", user.first_name)
          xml.tag!("cell", user.last_name)
          xml.tag!("cell", user.phone)
       end
    end
  end
  </code></pre>
  
  <p>below is my dbaction.rxml file.</p>
  
  <pre><code>xml.instruct! :xml, :version=&gt;"1.0" 
  
   xml.tag!("data") do
  
   xml.tag!("action",{ "type" =&gt; @mode, "sid" =&gt; @id, "tid" =&gt; @tid }) 
  
  end
  </code></pre>
  
  <p>Below is my route.rb file.</p>
  
  <pre><code>resource :admin do
    collection do
       get 'view'
       get 'data'
       get 'dbaction'
     end
   end
  </code></pre>
  
  <p>Below is migration file.</p>
  
  <pre><code>class CreateUsers &lt; ActiveRecord::Migration
     def self.up
  
      create_table :users do |t|
          t.string :first_name
          t.string :last_name
          t.string :phone
      t.timestamps
   end
  
   user.create(
      :first_name =&gt; "John",
      :last_name =&gt; "Smith",
      :phone =&gt; "997347854")
  
  user.create(
      :first_name =&gt; "Stanislav",
      :last_name =&gt; "Wolski",
      :phone =&gt; "465764778"
    end
  
   def self.down
    drop_table :users
   end
  </code></pre>
  
  <p>end</p>
  
  <p>This is the link i used to develop the above program
  <a href="http://www.dhtmlx.com/blog/?p=426" rel="nofollow">http://www.dhtmlx.com/blog/?p=426</a></p>