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(???)
任何及所有的帮助表示赞赏。