Module: Socializer::ApplicationHelper
- Defined in:
- app/helpers/socializer/application_helper.rb
Instance Method Summary collapse
- #current_user?(user) ⇒ Boolean
- #signin_path(provider) ⇒ Object
- #time_ago(time, options = {}) ⇒ Object
Instance Method Details
#current_user?(user) ⇒ Boolean
7 8 9 |
# File 'app/helpers/socializer/application_helper.rb', line 7 def current_user?(user) user == current_user end |
#signin_path(provider) ⇒ Object
3 4 5 |
# File 'app/helpers/socializer/application_helper.rb', line 3 def signin_path(provider) "/auth/#{provider.to_s}" end |
#time_ago(time, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/socializer/application_helper.rb', line 11 def time_ago(time, = {}) time = time.to_time.utc .reverse_merge! title: l(time, format: :short) [:data] ||= {} [:data].merge! time_ago: 'moment.js' time_tag time, time.strftime('%B %e, %Y %l:%M%P'), end |