I have written this generator code but it returns 'can't convert nil into String' when I call m.directory inside the manifest. Anyone know what had happened?
class AuthGenerator < Rails::Generator::NamedBase
attr_reader :user_class_name
def initialize(runtime_args, runtime_options={})
@user_class_name="User"
@controller_class_name="AccountController"
@user_class_file_name="#{@user_class_name}.rb"
@controller_class_file_name="#{@controller_class_name}.rb"
end
def manifest
record do |m|
m.class_collisions @controller_class_name, @user_class
puts @user_class_name
m.directory File.join('app/models', @user_class_name)
end
end
end