app/forms/tramway/landing/block_form.rb in tramway-landing-1.8 vs app/forms/tramway/landing/block_form.rb in tramway-landing-1.8.1
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class Tramway::Landing::BlockForm < ::Tramway::Core::ExtendedApplicationForm
properties :title,
:background,
:view_state,
:block_type,
@@ -14,31 +16,28 @@
:view_name
def initialize(object = nil)
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
+ background: :file,
+ position: :numeric,
+ block_type: :default,
+ navbar_link: :default,
+ anchor: :string,
+ description: :ckeditor,
+ button_title: :string,
+ button_link: :string
end
end
def button_title
model.button ||= {}
- model.button['title'] || ""
+ model.button['title'] || ''
end
def button_link
model.button ||= {}
- model.button['link'] || ""
+ model.button['link'] || ''
end
def button_title=(value)
model.button ||= {}
model.button[:title] = value