Class: DiasporaFederation::HCardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/diaspora_federation/h_card_controller.rb

Overview

This controller generates the hcard.

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_locale

Instance Method Details

#hcardObject

Returns the hcard of the user

GET /hcard/users/:guid



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/diaspora_federation/h_card_controller.rb', line 11

def hcard
  person_hcard = DiasporaFederation.callbacks.trigger(:fetch_person_for_hcard, params[:guid])

  if person_hcard.nil?
    head :not_found
  else
    logger.info "hcard profile request for: #{person_hcard.nickname}:#{person_hcard.guid}"
    # rubocop:disable Rails/OutputSafety
    render html: person_hcard.to_html.html_safe
    # rubocop:enable Rails/OutputSafety
  end
end