我正在使用simple_form_for。在這個我想要一個下降與幾個值。這些值是從控制器中返回這些值的散列的方法返回的。錯誤使用'路徑'收集:在simple_form_for
在視圖中我有:
= f.input :address_id, collection: address_string_gift_cards_path
控制器的方法是:
def address_string
#Some code here that returns hash of values
end
在我的路線文件我有:
resources :gift_cards do
collection do
get :address_string
end
end
在我收到錯誤的輸出:
undefined method `to_a' for "/gift_cards/address_string":String
我不知道我在做什麼錯誤。任何幫助將非常感激。在此先感謝:)
你可以發表你的表格 – Kaleidoscope