ViewComponent

View components for Rails from GitHub
Used 39 times
Created by
A Andrew Mason

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/VMys6p"

Template Source

Review the code before running this template on your machine.

def do_bundle
  Bundler.with_unbundled_env { run "bundle install" }
end

run "bundle add view_component"
do_bundle
inject_into_file "config/application.rb", "require \"view_component/engine\"\n", before: "# Require the gems listed in Gemfile, including any gems"
run "bin/rails generate component Example title content"
Mark
© 2020 GoRails, LLC