Fix/Solution for NoMethodError? (undefined method `controller_name’ for nil:NilClass)


This error appears when same action gets called twice. There might be chances to have controller with same name twice inside app as well as plugins

In my case the error appeared while migrating from rails 2.1 to 2.3.
Application was having application.rb and application_controller.rb

Files deleted:
trunk/app/controllers/application.rb

And that solved problem !

Advertisements

About sandipransing

Web Developer #ruby #rails #JS
This entry was posted in Ruby on Rails and tagged . Bookmark the permalink.

2 Responses to Fix/Solution for NoMethodError? (undefined method `controller_name’ for nil:NilClass)

  1. Satish says:

    from where you learnt NoMethodError is because of the same action called twice.

    Solution Rename application.rb => application_controller.rb

  2. I already have solution and reason for this error.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s