Class: Testimonials::CollectionController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Testimonials::CollectionController
- Defined in:
- app/controllers/testimonials/collection_controller.rb
Overview
The standalone public pages — the links you drop into an email or DM so people outside the app can answer: "#mount_path/new" for a testimonial, "#mount_path/nps/new" for the 0–10 score. Both are toggled by config.public_collection (ON by default); the NPS one also needs config.nps.
Instance Method Summary collapse
-
#nps ⇒ Object
The same widget code, opened straight onto the NPS card.
- #show ⇒ Object
Instance Method Details
#nps ⇒ Object
The same widget code, opened straight onto the NPS card. A promoter is offered the testimonial form right after scoring, inline on this page.
23 24 25 |
# File 'app/controllers/testimonials/collection_controller.rb', line 23 def nps head :not_found unless Testimonials.config.nps end |
#show ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/controllers/testimonials/collection_controller.rb', line 13 def show # A signed-in visitor edits their existing review (in this tenant) # instead of adding one. @existing = && Testimonial.for_tenant(current_tenant) .where(author_id: .to_s).newest_first.first end |