Module: ProfileHelper

Defined in:
app/helpers/profile_helper.rb

Instance Method Summary collapse

Instance Method Details

#optional_profile_section(section, options = {}) ⇒ Object



7
8
9
# File 'app/helpers/profile_helper.rb', line 7

def optional_profile_section(section, options = {})
  profile_section(section, options) if show_this_section?(section)
end

#profile_section(section, profile_field_options = {}) ⇒ Object



3
4
5
# File 'app/helpers/profile_helper.rb', line 3

def profile_section(section, profile_field_options = {})
  render partial: 'profiles/section', locals: { section: section, profile_field_options: profile_field_options }
end

#profile_sections_to_html(sections, options = {}) ⇒ Object

options:

- force_show


14
15
16
17
18
19
# File 'app/helpers/profile_helper.rb', line 14

def profile_sections_to_html(sections, options = {})
  sections = sections_to_be_shown(sections) unless options[:force_show]
  sections.collect do |section|
    profile_section(section)
  end.join.html_safe
end