Class: Renalware::ApplicationComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Renalware::ApplicationComponent
- Includes:
- Pundit::Helper
- Defined in:
- app/components/renalware/application_component.rb
Direct Known Subclasses
Renalware::Admissions::ActiveConsultAlertComponent, ArticleComponent, Events::EventListComponent, HD::AdministerPrescriptionDropdownComponent, HD::PrescriptionLastAdministrationComponent, Letters::LettersInProgressComponent, Letters::UnreadElectronicCCsComponent, Medications::TabbedPrescriptionsListComponent, Messaging::UnreadMessagesComponent, PD::AdequacyResultsComponent, PD::PETResultsComponent, Pathology::ChartComponent, Pathology::SparklineComponent, Patients::BookmarksComponent, Patients::MessagesComponent, Patients::SideMenuComponent, Surveys::EQ5DComponent, Surveys::POSSComponent, System::AdminMenuComponent, System::UsersAwaitingApprovalComponent, Users::LastSigninComponent
Instance Method Summary collapse
-
#policy(record) ⇒ Object
Added this helper as I can’t seem to get the Pundit #policy helper to be included in the context when rendering a component template.
-
#renalware ⇒ Object
Not sure why include Renalware::Engine.routes.url_helpers does not make the engine urls visible in the views (seems to resolve alwatys to /assets?..) so we expose routes here so inside a component html file we can use e.g.
Instance Method Details
#policy(record) ⇒ Object
Added this helper as I can’t seem to get the Pundit #policy helper to be included in the context when rendering a component template.
19 20 21 |
# File 'app/components/renalware/application_component.rb', line 19 def policy(record) current_user && Pundit.policy(current_user, record) end |
#renalware ⇒ Object
Not sure why include Renalware::Engine.routes.url_helpers does not make the engine urls visible in the views (seems to resolve alwatys to /assets?..) so we expose routes here so inside a component html file we can use e.g. renalware.bookmarks_path
13 14 15 |
# File 'app/components/renalware/application_component.rb', line 13 def renalware Renalware::Engine.routes.url_helpers end |