0
我有這樣一個模型:參數沒有名稱型號
class Attribute < ActiveRecord::Base
attr_accessible :name
end
和參數後的行動:
name='foo' (not attribute[name])
在創建行動,我可以創建屬性是這樣的:
attribute=Attribute.new(:name => params[:name])
如何告訴rails解析模型屬性等每個參數?
attribute=Attribute.new(params[:attribute])