I was building my own class that resides in /lib folder and debugging with rails console. I quickly comes to a problem, which I have to reload! my console everytime I modified my class file. Would like to know how to auto-reload this when file changed.
Following is my configuration:
Class Location
/lib/book.rb
Code
class Book
def hello
puts 'hello'
end
end
config/application.rb
config.autoload_paths += %W(#{config.root}/lib)
config.autoload_paths += Dir["#{config.root}/lib/**/"]
Console
rails c
Book.new.hello