Thursday, January 28, 2010

Solution to Undefined method `cache_template_extensions=' in Ruby on Rails

When you upgrade to rails version 2.2.x or later then some times you might get
the below error
Undefined method 'cache_template_extensions='

To fix this problem check your environment.rb and environemts/development.rb, production.rb, test.rb files and comment/remove the below line of co
de.

config.action_view.cache_template_extensions = false

Restart the server and see output.

Solution to uninitialized constant FileColumn::ClassMethods::Inflector in Ruby on Rails

When you install file column plugin in latest version of rails, you might got this noname or uninitialized error. To fix this error open the plugin/lib/file_colum.rb file goto line number 619 and add ActiveSupport:: before the Inflector. See the final code should be like below at line number 619.

my_options = FileColumn::init_options(options,
ActiveSupport::Inflector.underscore(self.name).to_s,
attr.to_s)

Also at line number 79 find and change as below

url << size="4">Restart the server and see the output.