Class: Tramway::Event::EventAsPageWithButtonDecorator

Inherits:
EventDecorator
  • Object
show all
Defined in:
app/decorators/tramway/event/event_as_page_with_button_decorator.rb

Instance Method Summary collapse

Instance Method Details

#anchorObject



4
5
6
# File 'app/decorators/tramway/event/event_as_page_with_button_decorator.rb', line 4

def anchor
  "event_#{object.id}"
end

#buttonObject



24
25
26
27
28
29
30
31
32
33
34
# File 'app/decorators/tramway/event/event_as_page_with_button_decorator.rb', line 24

def button
   :div do
    (
      :a,
      href: ::Tramway::Event::Engine.routes.url_helpers.event_path(object.id),
      class: 'btn btn-primary'
    ) do
      'Регистрация'
    end
  end
end

#descriptionObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/decorators/tramway/event/event_as_page_with_button_decorator.rb', line 12

def description
  if object.short_description.present?
     :div do
      concat duration
      concat  :br
      concat object.short_description
    end
  else
    duration
  end
end