Class: Organizations::Generators::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/organizations/views/views_generator.rb

Overview

Copies the reference views into the host app — the devise-views pattern (https://github.com/heartcombo/devise#configuring-views) for a BYO-UI engine: the engine's controllers render HOST views, so a fresh install hits missing-template errors until these exist. Run:

rails generate organizations:views

and retheme freely — the copies are yours. Tailwind-styled, matching the gem's test/dummy reference app (the templates here are kept byte-identical to the dummy's views by a sync test in the gem's suite, so the dummy remains the living, boot-able preview of what you get).

NOTE: verified joining (join screens, request queues, access management) is deliberately NOT part of this set — those surfaces are host ROUTES + CONTROLLERS too, not just views. Copy the reference implementation from the gem's test/dummy app instead (see README "Verified joining — reference UI").

Instance Method Summary collapse

Instance Method Details

#copy_viewsObject



29
30
31
# File 'lib/generators/organizations/views/views_generator.rb', line 29

def copy_views
  directory "organizations", "app/views/organizations"
end

#show_readmeObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/organizations/views/views_generator.rb', line 33

def show_readme
  say ""
  say "Organizations views copied to app/views/organizations/ — they're yours now; retheme freely.", :green
  say "These views use Tailwind classes and the `heroicon` helper: add `gem \"heroicons\"` (or"
  say "swap the icon calls for your own icon set)."
  say "The organization page's owner-only Danger Zone (transfer/delete) renders only if you"
  say "provide app/views/shared/_danger_zone.html.erb — copy the full-featured one (Stimulus"
  say "confirm modal included) from the gem's test/dummy app."
  say "Verified-joining surfaces (join screen, request queue, access management) are host"
  say "controllers + views: copy the reference implementation from the gem's test/dummy app."
  say ""
end