Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获得模型的大量可分配属性?
我找到了这个,但在我看来它有点脏。
Game.accessible_attributes.to_a.reject{|i| i.empty?}
有没有更清洁的方法?
我不明白为什么是拒绝功能。
你试过这个:
Game.accessible_attributes