Skip to content

Conversation

gtarsia
Copy link

@gtarsia gtarsia commented Jun 25, 2025

Does two things:

  • Adds flag --use-literal-gem/--no-use-literal-gem (default true) to the generator phlex:install
  • Adds the rails application template which asks if you want to use literal: if yes, installs literal, otherwise, uses the --no-use-literal-gem flag.

If you don't like where I placed the Rails application template (lib/templates/rails.rb) or want a more meaningful file name, let me know.

Comments:

  • I made Literal opt-out because I think the experience is awesome for components.
  • I will also push another PL for "Getting started" in the Phlex docs showing how to use this
  • I tested this locally in a new project by including this in a new rails project Gemfile:
gem 'phlex-rails', path: File.expand_path("~/git/phlex-rails")
  • It's kinda tricky to test otherwise because it runs a generator from the gem (which isn't up yet)

Anyone interested in using this should just add this to their Gemfile:
gem "phlex-rails", github: "gtarsia/phlex-rails"

@gtarsia gtarsia marked this pull request as draft August 12, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant