0
我在rails3.1中使用spine.js.one創建了兩個腳手架腳手架是hr,另一個是department.Spine:model hr has_many department,department belongs_to的hr.In教研室脊柱:控制器Department.find_all_by_hr_id(@hr_id)在spine.js中不起作用
class Index extends Spine.Controller
events:
'click [data-type=edit]': 'edit'
'click [data-type=destroy]': 'destroy'
'click [data-type=show]': 'show'
'click [data-type=hr]': 'hr'
constructor: ->
super
@active (params) ->
@change(params.id)
change: (id) ->
@item = Hr.find(id)
@[email protected]
@render()
render: =>
department = Department.find_all_by_hr_id(@hr_id)
@html @view('departments/index')(departments: deparment)
我試圖列出page.but我無法通過上面的代碼在部門指標使用hr_id百貨商店。 我在螢火蟲中有這樣的錯誤Department.find_all_by_hr_id(@hr_id) is not function
。 任何人都可以幫助我