2
我創建了一個可安裝的引擎rails plugin new golgi --mountable
。在gemspec文件中添加了cells gem作爲依賴項:s.add_dependency "cells"
。捆紮,以及運行發電機rails g cell cart show
產生以下結構:未定義的方法render_cell for Rails 3引擎
app/cells/golgi/cart /show.html erb
app/cells/golgi/cart_cell.rb
我然後試圖調用視圖/佈局/高爾基體/ application.html.erb render_cell :cart, :show
但我得到一個未定義的方法錯誤: undefined method 'render_cell' for #<#<Class:0x000001009ec590>:0x00000100931600>
請注意,我正在運行爲測試引擎提供的「虛擬」應用程序(/ test/dummy)。 我需要什麼使細胞與可安裝的引擎一起工作?