Class: Tramway::Landing::Block

Inherits:
ApplicationRecord show all
Defined in:
app/models/tramway/landing/block.rb

Instance Method Summary collapse

Instance Method Details

#footer?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/models/tramway/landing/block.rb', line 45

def footer?
  block_type.footer?
end

#form_to_renderObject



49
50
51
52
53
54
# File 'app/models/tramway/landing/block.rb', line 49

def form_to_render
  case values['form_url']
  when '/auth/sign_up'
    "#{Tramway::Auth.authenticable_models.first}SignUpForm".constantize
  end
end

#header?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/tramway/landing/block.rb', line 41

def header?
  block_type.in? %w[header header_with_form]
end


37
38
39
# File 'app/models/tramway/landing/block.rb', line 37

def link_object
  link_object_type.constantize.find link_object_id
end