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,
lib/generators/ideasbugs/migration_helpers.rb,
app/controllers/ideasbugs/widgets_controller.rb,
app/controllers/ideasbugs/dashboard_controller.rb,
app/controllers/ideasbugs/feedbacks_controller.rb,
app/controllers/ideasbugs/application_controller.rb,
app/controllers/ideasbugs/screenshots_controller.rb,
app/controllers/ideasbugs/submissions_controller.rb,
lib/generators/ideasbugs/tenant/tenant_generator.rb,
app/controllers/concerns/ideasbugs/request_context.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, RequestContext, Seeds, Widget, WidgetHelper Classes: ApplicationController, ApplicationRecord, Configuration, DashboardController, Engine, Feedback, FeedbacksController, ScreenshotsController, SubmissionsController, WidgetsController
Constant Summary collapse
- VERSION =
'0.8.2'
Class Method Summary collapse
- .admin?(request) ⇒ Boolean
-
.base_controller ⇒ Object
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
39 40 41 |
# File 'lib/ideasbugs.rb', line 39 def admin?(request) !!config..call(request) end |
.base_controller ⇒ Object
Can this request browse and triage feedback? Checked by every dashboard action. The class Ideasbugs::DashboardController inherits from. Resolved on every call rather than memoized, so a host that reassigns base_controller_class in a reloadable initializer is not pinned to a stale, unloaded constant.
35 36 37 |
# File 'lib/ideasbugs.rb', line 35 def base_controller config.base_controller_class.to_s.constantize 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.
53 54 55 |
# File 'lib/ideasbugs.rb', line 53 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.
46 47 48 |
# File 'lib/ideasbugs.rb', line 46 def tenant(request) config.tenant.call(request).presence&.to_s end |