Sha256: 653f7f2f67be696dd0c6b5773ef221bb2b1fdc9df549651c42905841cbf042a4

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 Bytes

Contents

#!/usr/bin/env bash

bin/rails g scaffold Post title body
bin/rails db:migrate

mkdir sandbox/app/overrides

echo <<RUBY >> sandbox/app/overrides/sparkling_title.rb
Deface::Override.new(
  virtual_path: "posts/show",
  name: "sparkling_title",
  replace: 'p:nth-child(2)',
  text: "<h1>✨<%= @post.title %>✨</h1>"
)

Deface::Override.new(
  virtual_path: "posts/show",
  name: "sparkling_body",
  replace: 'p:nth-child(3)',
  text: "<p style='border:2px gray solid; padding: 1rem;'><%= @post.body %></p>"
)
RUBY

bin/rails runner "Post.create(title: 'Foo', body: 'Bar '*10)"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deface-1.6.2 bin/sandbox-setup
deface-1.6.1 bin/sandbox-setup
deface-1.6.0 bin/sandbox-setup