Skip to content

Commit

Permalink
Merge branch 'feature/fix_event' of github.com:ulmic/tramway-dev into…
Browse files Browse the repository at this point in the history
… feature/fix_event
  • Loading branch information
moshinaan committed Jan 14, 2020
2 parents 376f531 + e905467 commit d9da89a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tramway-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,55 @@ Tramway::Core.initialize_application model_class: ::Tramway::Conference::Unity #
```ruby
Rails.application.config.assets.precompile += %w( *.jpg *.png *.js )
```
# Usage
## Decorators
### Helper methods

#### date_view
Returns a date in the format depending on localization

*app/decorators/\*_decorator.rb*
```ruby
def created_at
date_view object.created_at
end
```
#### datetime_view
Returns a date and time in the format depending on localization

*app/decorators/*_decorator.rb*
```ruby
def created_at
datetime_view object.created_at
end
```
#### state_machine_view
Returns the state of an object according to a state machine

*app/decorators/*_decorator.rb*
```ruby
def state
state_machine_view object, :state
end
```
#### image_view
Returns an image in a particular format depending on the parameters of the original image file

*app/decorators/\*_decorator.rb*
```ruby
def avatar
image_view object.avatar
end
```
#### enumerize_view
Returns object enumerations as text

*app/decorators/\*_decorator.rb*
```ruby
def field_type
enumerize_view object.field_type
end
```

# Базовые классы

Expand Down

0 comments on commit d9da89a

Please sign in to comment.