简体   繁体   中英

Ruby On Rails and “external classes”

I have RSS-reader class for Ruby, and I'd want to use it in rails, where does the rss_reader.rb go? To "libs/rss_reader.rb"?

I tried that, then requiring it in controller, but I get error: 'MissingSourceFile (no such file to load -- lib/RssReader)'

如果将您的类放在“ RAILS_ROOT / lib /”中,它将被自动加载,并要求“ lib / rss_reader”能够正常工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM