Tutorial by Examples

Most Rails developers start by modifying their model information within the template itself: <h1><%= "#{ @user.first_name } #{ @user.last_name }" %></h1> <h3>joined: <%= @user.created_at.in_time_zone(current_user.timezone).strftime("%A, %d %b %Y %l:%M %p&q...
Draper automatically matches up models with their decorators by convention. # app/decorators/user_decorator.rb class UserDecorator < Draper::Decorator def full_name "#{object.first_name} #{object.last_name}" end def created_at Time.use_zone(h.current_user.timezone...

Page 1 of 1