title: superclass mismatch for class CommentsController (TypeError), best way to rename?
body: <p>I ran into some problem tonight while deploying and I'm trying to get this fixed asap</p>
  
  <p>I have no idea why this is happening. Everything works fine locally but not on heroku. I tried all sorts of different fixes after researching but I may have to resort to renaming this class CommentsController completely (hopefully that works). What is the best way to go about that? I'm pretty new to Rails so I need some help on making these changing correctly. </p>
  
  <p>Here's what the CommentsController looks like FYI:</p>
  
  <pre><code>class CommentsController &lt; ApplicationController
    def new
      @post = Post.new(params[:post])
    end
  
    def show
      @comment = Comment.find(params[:id])
      respond_to do |format|
        format.js
      end
    end
  
    def create
      @post = Post.find(params[:post_id])
      @comment = Comment.new(params[:comment])
      @comment.micropost = @post
      @comment.user = current_user
      if @comment.save
        redirect_to(:back)
      else
        render partial: 'shared/_comment_form', locals: { post: @post }
      end
    end
  end
  </code></pre>
  
  <p>Comments are associated to each post (users are able to comment on posts). I will post other codes up as well if needed. </p>
  
  <p>Here's the error from heroku logs</p>
  
  <pre><code>2013-04-09T05:55:19.454545+00:00 app[web.2]: /app/app/controllers/comments_contr
  oller.rb:1:in `&lt;top (required)&gt;': superclass mismatch for class CommentsControll
  er (TypeError)
  </code></pre>
  
  <p>Routes.db</p>
  
  <pre><code>SampleApp::Application.routes.draw do
    resources :posts, :path =&gt; "posts"
  
    resources :users do
      resources :messages do
        collection do
          post :delete_selected
        end
      end
    end
  
    ActiveAdmin.routes(self)
  
    devise_for :admin_users, ActiveAdmin::Devise.config
  
    resources :users do
      member do
        get :following, :followers
      end
    end
  
    resources :sessions, only: [:new, :create, :destroy]
    resources :posts, only: [:create, :destroy]
    resources :relationships, only: [:create, :destroy]
    resources :posts do
      resources :comments
    end
  
    root to: 'static_pages#home'
  
    match '/signup',   to: 'users#new'
    match '/signin',   to: 'sessions#new'
    match '/signout',  to: 'sessions#destroy', via: :delete
  
    match '/post',    to: 'static_pages#post'
    match '/post1',   to: 'static_pages#post1'
    match '/faq',     to: 'static_pages#faq'
    match '/review',  to: 'users#review'
    match "/posts/:id/review" =&gt; "posts#review"
  end
  </code></pre>
  
  <p>When I ran advanced indexed search inside the rails app folder, here were the relevant files that came up</p>
  
  <pre><code>- comments_controller.rb
  - comments_helper.rb
  - comments_helper_spec.rb
  - comments_controller_spec.rb
  - 3 migration files
  - routes.rb (posted above)
  - schema.rb (table called "active_admin_comments" and table called "comments')
  - post.rb model (has_many :comments)
  - user.rb model (has_many :comments)
  - comment.rb model
  - active_admin.rb in config/initializer (any instance where I find "comments" has been #'ed out")
  </code></pre>