Module: Ideasbugs
- Defined in:
- lib/ideasbugs.rb,
lib/ideasbugs/seeds.rb,
lib/ideasbugs/engine.rb,
lib/ideasbugs/widget.rb,
lib/ideasbugs/version.rb,
lib/ideasbugs/has_feedback.rb,
lib/ideasbugs/configuration.rb,
app/models/ideasbugs/feedback.rb,
app/helpers/ideasbugs/widget_helper.rb,
app/models/ideasbugs/application_record.rb,
app/controllers/ideasbugs/widgets_controller.rb,
app/controllers/ideasbugs/feedbacks_controller.rb,
app/controllers/ideasbugs/application_controller.rb,
app/controllers/ideasbugs/screenshots_controller.rb,
lib/generators/ideasbugs/tenant/tenant_generator.rb,
lib/generators/ideasbugs/install/install_generator.rb
Overview
In-app product feedback collection for Rails. A drop-in widget lets users send bug reports, feature requests, and general feedback (with screenshots) from any page; submissions land in your own database, with a minimal built-in dashboard to browse and triage them.
Defined Under Namespace
Modules: Generators, HasFeedback, Seeds, Widget, WidgetHelper Classes: ApplicationController, ApplicationRecord, Configuration, Engine, Feedback, FeedbacksController, ScreenshotsController, WidgetsController
Constant Summary collapse
- VERSION =
'0.7.7'
Class Method Summary collapse
-
.admin?(request) ⇒ Boolean
Can this request browse and triage feedback? Checked by every dashboard action.
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
-
.enabled?(request) ⇒ Boolean
Can this request send feedback? Checked on the server for the endpoint and by the helper before rendering the widget.
-
.for(record) ⇒ Object
The feedback belonging to a host record, keyed by its GlobalID — the documented tenant convention.
-
.tenant(request) ⇒ Object
The tenant key for this request, or nil for the single global board.
Class Method Details
.admin?(request) ⇒ Boolean
Can this request browse and triage feedback? Checked by every dashboard action.
32 33 34 |
# File 'lib/ideasbugs.rb', line 32 def admin?(request) !!config..call(request) end |
.config ⇒ Object
16 17 18 |
# File 'lib/ideasbugs.rb', line 16 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
20 21 22 |
# File 'lib/ideasbugs.rb', line 20 def configure yield config end |
.enabled?(request) ⇒ Boolean
Can this request send feedback? Checked on the server for the endpoint and by the helper before rendering the widget.
26 27 28 |
# File 'lib/ideasbugs.rb', line 26 def enabled?(request) !!config.enabled.call(request) end |
.for(record) ⇒ Object
The feedback belonging to a host record, keyed by its GlobalID — the
documented tenant convention. Sugar for Feedback.for_tenant(...); the
has_feedback model concern is built on this.
46 47 48 |
# File 'lib/ideasbugs.rb', line 46 def for(record) Feedback.for_tenant(tenant_key_for(record)) end |
.tenant(request) ⇒ Object
The tenant key for this request, or nil for the single global board.
Normalized to a string so where(tenant:) is consistent whether the
resolver returns a GlobalID, an integer id, or a slug; blank becomes nil.
39 40 41 |
# File 'lib/ideasbugs.rb', line 39 def tenant(request) config.tenant.call(request).presence&.to_s end |