Module: UserAnnouncements::RolesHelper
- Included in:
- UserAnnouncementsHelper
- Defined in:
- app/helpers/user_announcements/roles_helper.rb
Defined Under Namespace
Classes: Role
Instance Method Summary collapse
-
#ua_roles_display(announcement) ⇒ Object
Roles display on index page.
-
#ua_roles_html(f) ⇒ Object
Roles checkboxes for admin detail form.
Instance Method Details
#ua_roles_display(announcement) ⇒ Object
Roles display on index page
14 15 16 17 18 |
# File 'app/helpers/user_announcements/roles_helper.rb', line 14 def ua_roles_display(announcement) role_names = announcement.roles.map { |role_id| _ua_role_id_to_name(role_id) } safe_join(role_names, '<br />'.html_safe) end |
#ua_roles_html(f) ⇒ Object
Roles checkboxes for admin detail form
5 6 7 8 9 10 11 |
# File 'app/helpers/user_announcements/roles_helper.rb', line 5 def ua_roles_html(f) return unless _ua_roles.present? f.label(:roles) + ua_br + _ua_roles_checkboxes(_ua_roles) end |