0
我正在努力爲開源項目jquery-datatables-rails做出貢獻。但它讓我困惑,因爲它是如何工作的。我對如何創建寶石有基本的瞭解。看起來這個項目只是簡化了路徑引用,但沒有更多。列出安裝的四個步驟是Rails資產管道:當我們需要在application.js時會發生什麼
Add to the assets group in your Gemfile:
gem 'jquery-datatables-rails'
Install the gem:
bundle install
Add the JavaScript to application.js:
//= require dataTables/jquery.dataTables
Add the stylesheets to application.css:
*= require dataTables/jquery.dataTables
但我不明白的Rails如何知道哪裏可以找到數據表文件夾,爲什麼我們使用jquery.dataTables中引用文件/類。代碼很容易理解,但文件組織讓我非常困惑。有沒有關於我的困惑的話題寫作? 謝謝。
更新: 剛剛發現on Rails的引擎這個偉大的文檔:http://edgeguides.rubyonrails.org/engines.html