我只是想了解 Rails 的一部分,特别是 access_attributes
请参见下面的示例:
irb(main):001:0> Ec2TypeSpecification.accessible_attributes
=> #<ActiveModel::MassAssignmentSecurity::WhiteList: {"", "api_name", "api_size", "api_type", "cores", "core_type", "compute_units", "ebs_optimization", "ephemeral_drives", "io_performance", "max_ips", "memory", "name", "support_32_bit", "support_64_bit", "total_ephemeral_storage"}>
为什么是空字符串?它有什么作用?或者,我的模型有什么问题吗?
gem 'rails', '3.2.13'
编辑:添加模型
这就是整个模型(我的项目不是很远)
class Ec2TypeSpecification < ActiveRecord::Base
attr_accessible :api_name, :api_size, :api_type, :cores, :core_type, :compute_units, :ebs_optimization,
:ephemeral_drives, :io_performance, :max_ips, :memory, :name, :support_32_bit, :support_64_bit,
:total_ephemeral_storage
end