2
有沒有辦法將燈具轉換爲一組ActionController :: Parameters?Rails 3:將燈具轉換爲一組ActionController ::參數
例如:
# contacts.yml
dan:
first_name: Dan
last_name: Gebhardt
email: [email protected]
notes: Writes sample code without tests :/
joe:
first_name: Joe
last_name: Blow
email: [email protected]
notes: Lousy plumber
# contacts_test.rb
@dan = contacts(:dan)
# create params that represent Dan?
@dan_as_params = ActionController::Parameters.new(???)
任何及所有的幫助表示讚賞。