app/forms/tramway/landing/block_form.rb in tramway-landing-1.7.2 vs app/forms/tramway/landing/block_form.rb in tramway-landing-1.8
- old
+ new
@@ -1,21 +1,34 @@
class Tramway::Landing::BlockForm < ::Tramway::Core::ExtendedApplicationForm
- properties :title, :background, :view_state, :block_type, :position, :navbar_link, :anchor, :description, :link_object_type, :link_object_id, :button_title, :button_link
+ properties :title,
+ :background,
+ :view_state,
+ :block_type,
+ :position,
+ :navbar_link,
+ :anchor,
+ :description,
+ :link_object_type,
+ :link_object_id,
+ :button_title,
+ :button_link,
+ :view_name
def initialize(object = nil)
- form_object = super object
- form_properties title: :string,
- background: :file,
- position: :numeric,
- block_type: :default,
- navbar_link: :default,
- anchor: :string,
- description: :ckeditor,
- link_object_type: :default,
- link_object_id: :numeric,
- button_title: :string,
- button_link: :string
- form_object
+ super(object).tap do
+ form_properties title: :string,
+ background: :file,
+ position: :numeric,
+ block_type: :default,
+ navbar_link: :default,
+ anchor: :string,
+ description: :ckeditor,
+ link_object_type: :default,
+ link_object_id: :numeric,
+ button_title: :string,
+ button_link: :string,
+ view_name: :string
+ end
end
def button_title
model.button ||= {}
model.button['title'] || ""