Method: Scrivito::BasicWidget.new
- Defined in:
- app/cms/scrivito/basic_widget.rb
.new(attributes = {}, context = {}) ⇒ Widget
Note:
Note that creating a widget does not implicitly persist it. The widget is only persisted if its creation is part of the creation of the object containing it, or as the object or widget containing it is updated.
Creates a new Widget. The defaults set via Widget.default_for are taken into account.
148 149 150 151 152 153 154 |
# File 'app/cms/scrivito/basic_widget.rb', line 148 def self.new(attributes = {}, context = {}) if obj_class = extract_obj_class_from_attributes(attributes) obj_class.new(attributes, context) else super(build_attributes_with_defaults(attributes, context)) end end |