rails_app_generator 0.2.21 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/generators/project-plan.rb +16 -2
- data/CHANGELOG.md +24 -0
- data/after_templates/addons/avo/_.rb +54 -0
- data/after_templates/addons/avo/app/controllers/home_controller.rb +4 -0
- data/after_templates/addons/avo/app/views/home/index.html.erb +3 -0
- data/after_templates/addons/avo/app/views/layouts/_footer.html.erb +3 -0
- data/after_templates/addons/avo/app/views/layouts/_navbar.html.erb +8 -0
- data/after_templates/addons/avo/app/views/layouts/application.html.erb +23 -0
- data/after_templates/addons/avo/db/seeds.rb +132 -0
- data/after_templates/addons/devise/_.rb +70 -0
- data/after_templates/addons/devise/app/controllers/home_controller.rb +4 -0
- data/after_templates/addons/devise/app/controllers/posts_controller.rb +81 -0
- data/after_templates/addons/devise/app/models/post.rb +11 -0
- data/after_templates/addons/devise/app/models/user.rb +17 -0
- data/after_templates/addons/devise/app/views/home/index.html.erb +40 -0
- data/after_templates/addons/devise/app/views/layouts/_footer.html.erb +1 -0
- data/after_templates/addons/devise/app/views/layouts/_navbar.html.erb +10 -0
- data/after_templates/addons/devise/app/views/layouts/application.html.erb +38 -0
- data/after_templates/addons/devise/app/views/posts/_form.html.erb +27 -0
- data/after_templates/addons/devise/app/views/posts/_post.html.erb +14 -0
- data/after_templates/addons/devise/app/views/posts/index.html.erb +12 -0
- data/after_templates/addons/devise/app/views/posts/show.html.erb +8 -0
- data/after_templates/addons/devise/db/seeds.rb +11 -0
- data/after_templates/addons/minimal_css/_.rb +62 -0
- data/after_templates/addons/minimal_css/app/controllers/home_controller.rb +4 -0
- data/after_templates/addons/minimal_css/app/views/home/index.html.erb +140 -0
- data/after_templates/addons/minimal_css/app/views/layouts/_footer.html.erb +1 -0
- data/after_templates/addons/minimal_css/app/views/layouts/_navbar.html.erb +3 -0
- data/after_templates/addons/minimal_css/app/views/layouts/application.html.erb +29 -0
- data/after_templates/addons/minimal_css/db/seeds.rb +5 -0
- data/after_templates/rag/devise/_.rb +14 -17
- data/after_templates/rag/devise/app/controllers/home_controller.rb +4 -0
- data/after_templates/rag/devise/{post → app/controllers}/posts_controller.rb +0 -0
- data/after_templates/rag/devise/{post → app/models}/post.rb +0 -0
- data/after_templates/rag/devise/app/views/home/index.html.erb +3 -0
- data/after_templates/rag/devise/app/views/layouts/_footer.html.erb +3 -0
- data/after_templates/rag/devise/app/views/layouts/_navbar.html.erb +8 -0
- data/after_templates/rag/devise/app/views/layouts/application.html.erb +24 -0
- data/after_templates/rag/devise/{post → app/views/post}/_post.html.erb +0 -0
- data/after_templates/rag/test/_.rb +64 -0
- data/after_templates/rag/test/app/controllers/home_controller.rb +4 -0
- data/after_templates/rag/test/app/views/home/index.html.erb +3 -0
- data/after_templates/rag/test/app/views/layouts/_footer.html.erb +1 -0
- data/after_templates/rag/test/app/views/layouts/_navbar.html.erb +5 -0
- data/after_templates/rag/test/app/views/layouts/application.html.erb +29 -0
- data/after_templates/rag/test/db/seeds.rb +7 -0
- data/after_templates/rag/testy/_.rb +64 -0
- data/after_templates/rag/testy/app/controllers/home_controller.rb +4 -0
- data/after_templates/rag/testy/app/views/home/index.html.erb +3 -0
- data/after_templates/rag/testy/app/views/layouts/_footer.html.erb +1 -0
- data/after_templates/rag/testy/app/views/layouts/_navbar.html.erb +5 -0
- data/after_templates/rag/testy/app/views/layouts/application.html.erb +29 -0
- data/after_templates/rag/testy/db/seeds.rb +7 -0
- data/docs/last_run/app_generator_class.json +58 -34
- data/docs/last_run/app_generator_data.json +13 -10
- data/docs/last_run/rails_options_class.json +48 -24
- data/docs/last_run/rails_options_data.json +13 -10
- data/docs/project-plan/project.drawio +65 -59
- data/docs/project-plan/project_done.svg +1 -1
- data/lib/rails_app_generator/addon.rb +20 -2
- data/lib/rails_app_generator/addons/avo.rb +27 -0
- data/lib/rails_app_generator/addons/devise.rb +78 -28
- data/lib/rails_app_generator/addons/devise_old.rb +22 -0
- data/lib/rails_app_generator/addons/minimal_css.rb +70 -0
- data/lib/rails_app_generator/app_generator.rb +39 -20
- data/lib/rails_app_generator/gem_query.rb +34 -0
- data/lib/rails_app_generator/rag_initializer.rb +24 -8
- data/lib/rails_app_generator/version.rb +1 -1
- data/lib/rails_app_generator.rb +1 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/avo.json +16 -0
- data/profiles/addons/devise.json +16 -0
- data/profiles/addons/minimal_css.json +15 -0
- data/profiles/rag/testy.json +12 -0
- data/tasks/addon.thor +7 -3
- data/tasks/profile.thor +3 -3
- data/templates/Gemfile.erb +1 -0
- data/{after_templates/rag/devise/turbo_controller.rb → templates/addons/devise/app/controllers/turbo_devise_controller.rb} +4 -10
- data/templates/addons/devise/app/controllers/users/registrations_controller.rb +62 -0
- data/templates/addons/devise/app/views/devise/registrations/edit.html.erb +40 -54
- data/templates/addons/devise/app/views/devise/registrations/new.html.erb +32 -43
- data/templates/addons/devise/app/views/layouts/_alerts.html.erb +2 -0
- data/{after_templates/rag → templates/addons}/devise/config/initializers/devise_turbo.rb +1 -1
- data/templates/thor_task/profile/after_template.rb +1 -1
- data/templates/thor_task/profile/app/views/layouts/_footer.html.erb.tt +1 -3
- data/templates/thor_task/profile/app/views/layouts/_navbar.html.erb +5 -8
- data/templates/thor_task/profile/app/views/layouts/application.html.erb.tt +8 -2
- data/templates/thor_task/profile/db/seeds.rb +2 -11
- metadata +64 -17
- data/after_templates/rag/devise/application.html.erb +0 -20
- data/tasks/gem_info.rb +0 -47
- data/templates/addons/devise/app/views/devise/confirmations/new.html.erb +0 -24
- data/templates/addons/devise/app/views/devise/passwords/edit.html.erb +0 -34
- data/templates/addons/devise/app/views/devise/passwords/new.html.erb +0 -23
- data/templates/addons/devise/app/views/devise/sessions/new.html.erb +0 -33
- data/templates/addons/devise/app/views/devise/shared/_error_messages.html.erb +0 -15
- data/templates/addons/devise/app/views/devise/shared/_form_wrap.html.erb +0 -5
- data/templates/addons/devise/app/views/devise/shared/_links.html.erb +0 -25
- data/templates/addons/devise/app/views/devise/unlocks/new.html.erb +0 -22
@@ -0,0 +1,11 @@
|
|
1
|
+
david = User.create(email: 'david@site.com', name: 'david', password: 'password', password_confirmation: 'password', role: :admin)
|
2
|
+
james = User.create(email: 'james@site.com', name: 'james', password: 'password', password_confirmation: 'password')
|
3
|
+
sally = User.create(email: 'sally@site.com', name: 'sally', password: 'password', password_confirmation: 'password', role: :moderator)
|
4
|
+
|
5
|
+
10.times do
|
6
|
+
Post.create(
|
7
|
+
title: "Post #{Faker::Lorem.words(number: rand(1..3)).join(' ')}",
|
8
|
+
body: "#{Faker::Lorem.sentences(number: 8).join("<br />")}",
|
9
|
+
views: 0,
|
10
|
+
user: User.all.sample)
|
11
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Description goes here
|
4
|
+
#
|
5
|
+
# exe/rag addons/minimal_css
|
6
|
+
|
7
|
+
self.local_template_path = File.dirname(__FILE__)
|
8
|
+
|
9
|
+
gac 'base rails 7 image created'
|
10
|
+
|
11
|
+
prepare_environment
|
12
|
+
|
13
|
+
add_controller('home', 'index')
|
14
|
+
|
15
|
+
route("root 'home#index'")
|
16
|
+
|
17
|
+
force_copy
|
18
|
+
|
19
|
+
directory "app/controllers"
|
20
|
+
directory "app/views/home"
|
21
|
+
directory "app/views/layouts"
|
22
|
+
template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
23
|
+
|
24
|
+
template 'db/seeds.rb' , 'db/seeds.rb'
|
25
|
+
|
26
|
+
after_bundle do
|
27
|
+
setup_db
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_db
|
31
|
+
add_scaffold('person', 'first_name', 'last_name', 'age:integer', 'address:text')
|
32
|
+
|
33
|
+
db_migrate
|
34
|
+
db_seed
|
35
|
+
end
|
36
|
+
|
37
|
+
# Other template command examples
|
38
|
+
# prepare_environment
|
39
|
+
# bundle_install
|
40
|
+
# css_install('tailwind')
|
41
|
+
# rails_command('db:migrate')
|
42
|
+
# rails_command('db:migrate')
|
43
|
+
# bundle_add('hotwire-rails')
|
44
|
+
# rails_command('hotwire:install')
|
45
|
+
# run('bin/importmap pin sortablejs')
|
46
|
+
# run('npm install daisyui')
|
47
|
+
# rubocop
|
48
|
+
#
|
49
|
+
# directory 'app/assets/images'
|
50
|
+
# create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
|
51
|
+
# append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
|
52
|
+
# insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
|
53
|
+
# before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
|
54
|
+
# gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
|
55
|
+
# template 'home.css', 'app/assets/stylesheets/home.css'
|
56
|
+
#
|
57
|
+
# add_controller('page', 'benefits', 'faq', 'terms', 'privacy', '--skip-routes')
|
58
|
+
# route(<<-'RUBY')
|
59
|
+
# PageController.action_methods.each do |action|
|
60
|
+
# get "/#{action}", to: "page##{action}", as: "page_#{action}"
|
61
|
+
# end
|
62
|
+
# RUBY
|
@@ -0,0 +1,140 @@
|
|
1
|
+
<h1>Minimal css</h1>
|
2
|
+
|
3
|
+
<p>The HTML below comes from the demo on Water.css</p>
|
4
|
+
|
5
|
+
<h2>Element demos</h2>
|
6
|
+
<p>This is supposed to be a demo page so we need more elements!</p>
|
7
|
+
<h3>Form elements</h3>
|
8
|
+
<form>
|
9
|
+
<label for="email">Email</label> <input type="email" name="email" id="email" placeholder="john.doe@gmail.com" />
|
10
|
+
<label for="id">User id (read only)</label> <input readonly="" name="id" id="id" value="04D6H89Z" />
|
11
|
+
<label for="disabled">Random disabled input</label>
|
12
|
+
<input disabled="" name="disabled" id="disabled" placeholder="Because why not?" />
|
13
|
+
<label for="about">About me</label> <textarea name="about" id="about" placeholder="I am a textarea..."></textarea>
|
14
|
+
<label>Choose a Doe:</label>
|
15
|
+
<div>
|
16
|
+
<input type="radio" id="john" name="drone" value="john" checked="" />
|
17
|
+
<label for="john">John Doe</label>
|
18
|
+
</div>
|
19
|
+
<div>
|
20
|
+
<input type="radio" id="jane" name="drone" value="jane" checked="" />
|
21
|
+
<label for="jane">Jane Doe</label>
|
22
|
+
</div>
|
23
|
+
<div>
|
24
|
+
<input type="radio" id="johnny" name="drone" value="johnny" checked="" />
|
25
|
+
<label for="johnny">Johnny Doe</label>
|
26
|
+
</div>
|
27
|
+
<br />
|
28
|
+
<input type="checkbox" name="remember" id="remember" checked="" />
|
29
|
+
<label for="remember">Remember me</label>
|
30
|
+
|
31
|
+
<input type="submit" value="Submit" />
|
32
|
+
<input type="reset" value="Reset" />
|
33
|
+
</form>
|
34
|
+
<h3 id="code">Code</h3>
|
35
|
+
<p>
|
36
|
+
Below is some code, you can copy it with <kbd>Ctrl-C</kbd>. Did you know, <code>alert(1)</code> can show an alert in
|
37
|
+
JavaScript!
|
38
|
+
</p>
|
39
|
+
<pre style="position: relative">
|
40
|
+
<code>// This logs a message to the console and check out the scrollbar.<br>console.log('Hello, world!')</code>
|
41
|
+
<div class="open_grepper_editor" title="Edit & Save To Grepper"></div>
|
42
|
+
</pre>
|
43
|
+
<h3>Other</h3>
|
44
|
+
<p>Here's a horizontal rule and image because I don't know where else to put them.</p>
|
45
|
+
<img src="https://placekitten.com/408/287" alt="Example kitten" />
|
46
|
+
<hr />
|
47
|
+
<p>And here's a nicely marked up table!</p>
|
48
|
+
|
49
|
+
<table>
|
50
|
+
<thead>
|
51
|
+
<tr>
|
52
|
+
<th>Name</th>
|
53
|
+
<th>Quantity</th>
|
54
|
+
<th>Price</th>
|
55
|
+
</tr>
|
56
|
+
</thead>
|
57
|
+
<tbody>
|
58
|
+
<tr>
|
59
|
+
<td>Godzilla</td>
|
60
|
+
<td>2</td>
|
61
|
+
<td>$299.99</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>Mozilla</td>
|
65
|
+
<td>10</td>
|
66
|
+
<td>$100,000.00</td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td>Quesadilla</td>
|
70
|
+
<td>1</td>
|
71
|
+
<td>$2.22</td>
|
72
|
+
</tr>
|
73
|
+
</tbody>
|
74
|
+
</table>
|
75
|
+
|
76
|
+
<details>
|
77
|
+
<summary>Some summary/details can't hurt!</summary>
|
78
|
+
<p>Lorem ipsum dolor sit blah blah.</p>
|
79
|
+
</details>
|
80
|
+
|
81
|
+
<p>The dialog (form, and menu) tag</p>
|
82
|
+
<div><button type="button" id="dialog-trigger">Show me the dialog!</button> <span id="dialog-result"></span></div>
|
83
|
+
<dialog id="dialog">
|
84
|
+
<header>This is a sample dialog</header>
|
85
|
+
<form method="dialog">
|
86
|
+
<p>What is your favorite pet animal?</p>
|
87
|
+
<menu>
|
88
|
+
<button value="feline">Cats</button> <button value="canine">Dogs</button> <button value="other">Others</button>
|
89
|
+
</menu>
|
90
|
+
</form>
|
91
|
+
</dialog>
|
92
|
+
<h3 id="typography">Typography</h3>
|
93
|
+
<p>
|
94
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dictum hendrerit velit, quis ullamcorper sem congue
|
95
|
+
ac. Quisque id magna rhoncus, sodales massa vel, vestibulum elit. Duis ornare accumsan egestas. Proin maximus lacus
|
96
|
+
interdum leo molestie convallis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus
|
97
|
+
mus. Ut iaculis risus eu felis feugiat, eu mollis neque elementum. Donec interdum, nisl id dignissim iaculis, felis
|
98
|
+
dui aliquet dui, non fermentum velit lectus ac quam. Class aptent taciti sociosqu ad litora torquent per conubia
|
99
|
+
nostra, per inceptos himenaeos. <strong>This is strong,</strong> this is normal, <b>this is just bold,</b>
|
100
|
+
<em>and this is emphasized!</em> And heck, <a href="/">here</a>'s a link.
|
101
|
+
</p>
|
102
|
+
<blockquote cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote">
|
103
|
+
"The HTML blockquote Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended
|
104
|
+
quotation. Usually, this is rendered visually by indentation (see
|
105
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote#Usage_notes">Notes</a> for how to change
|
106
|
+
it). A URL for the source of the quotation may be given using the <code>cite</code> attribute, while a text
|
107
|
+
representation of the source can be given using the <code><cite></code> cite element."
|
108
|
+
<footer><cite>MDN, "The Block Quotation element"</cite></footer>
|
109
|
+
</blockquote>
|
110
|
+
<ul>
|
111
|
+
<li>Unordered list item 1</li>
|
112
|
+
<li>Unordered list item 2</li>
|
113
|
+
<li>Unordered list item 3</li>
|
114
|
+
</ul>
|
115
|
+
<ol>
|
116
|
+
<li>Ordered list item 1</li>
|
117
|
+
<li>Ordered list item 2</li>
|
118
|
+
<li>Ordered list item 3</li>
|
119
|
+
</ol>
|
120
|
+
<p>Addresses are also styled to be <strong>awesome</strong>!</p>
|
121
|
+
<address>
|
122
|
+
<a href="mailto:john.doe@example.com">john.doe@example.com</a><br />
|
123
|
+
<a href="tel:778-330-2389">778-330-2389</a><br />
|
124
|
+
<a href="sms:666-666-6666">666-666-6666</a><br />
|
125
|
+
</address>
|
126
|
+
<br />
|
127
|
+
<h1>Heading 1</h1>
|
128
|
+
<h2>Heading 2</h2>
|
129
|
+
<h3>Heading 3</h3>
|
130
|
+
<h4>Heading 4</h4>
|
131
|
+
<h5>Heading 5</h5>
|
132
|
+
<h6>Heading 6</h6>
|
133
|
+
<footer><a href="#">Back to top ⬆</a></footer>
|
134
|
+
<script src="script.js" defer=""></script>
|
135
|
+
<div style="position: static !important">
|
136
|
+
<div
|
137
|
+
data-lastpass-infield="true"
|
138
|
+
style="position: absolute !important; top: 0px !important; left: 0px !important"
|
139
|
+
></div>
|
140
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<hr />
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= camelized %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<%%= csrf_meta_tags %>
|
7
|
+
<%%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%- if options[:skip_hotwire] || options[:skip_javascript] -%>
|
10
|
+
<%%= stylesheet_link_tag "application" %>
|
11
|
+
<%- else -%>
|
12
|
+
<%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
13
|
+
<%- end -%>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<header>
|
18
|
+
<%%= render 'layouts/navbar' %>
|
19
|
+
<hr />
|
20
|
+
</header>
|
21
|
+
<main>
|
22
|
+
<%%= yield %>
|
23
|
+
</main>
|
24
|
+
<footer>
|
25
|
+
<%%= render 'layouts/footer' %>
|
26
|
+
</footer>
|
27
|
+
</body>
|
28
|
+
</html>
|
29
|
+
|
@@ -7,35 +7,32 @@ self.local_template_path = File.dirname(__FILE__)
|
|
7
7
|
|
8
8
|
gac 'base rails 7 image created'
|
9
9
|
|
10
|
-
|
10
|
+
prepare_environment
|
11
11
|
|
12
|
+
add_controller('home', 'index')
|
12
13
|
add_scaffold('post', 'title', 'body:text')
|
13
|
-
route("root 'posts#index'")
|
14
|
+
# route("root 'posts#index'")
|
15
|
+
# generate('devise:views')
|
14
16
|
|
15
17
|
force_copy
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
directory "app/controllers"
|
20
|
+
directory "app/views"
|
19
21
|
|
20
|
-
copy_file '
|
21
|
-
copy_file 'layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
|
22
|
-
copy_file 'layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
|
23
|
-
template 'layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
22
|
+
# copy_file 'application_controller.rb' , 'app/controllers/application_controller.rb'
|
24
23
|
|
25
|
-
copy_file '
|
26
|
-
|
27
|
-
copy_file '
|
28
|
-
|
29
|
-
copy_file 'post/post.rb' , 'app/models/post.rb'
|
24
|
+
# copy_file 'layouts/_alerts.html.erb' , 'app/views/layouts/_alerts.html.erb'
|
25
|
+
# copy_file 'layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
|
26
|
+
# copy_file 'layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
|
27
|
+
# template 'layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
30
28
|
|
31
29
|
copy_file 'user.rb' , 'app/models/user.rb'
|
32
30
|
|
33
|
-
copy_file 'application.html.erb' , 'app/views/layouts/application.html.erb'
|
34
|
-
copy_file 'application_controller.rb' , 'app/controllers/application_controller.rb'
|
35
|
-
|
36
|
-
add_migration('add_user_to_posts', 'user:belongs_to')
|
31
|
+
# copy_file 'application.html.erb' , 'app/views/layouts/application.html.erb'
|
32
|
+
# copy_file 'application_controller.rb' , 'app/controllers/application_controller.rb'
|
37
33
|
|
38
34
|
after_bundle do
|
35
|
+
add_migration('add_user_to_posts', 'user:belongs_to')
|
39
36
|
db_migrate
|
40
37
|
|
41
38
|
append_to_file('db/seeds.rb', read_template('seed_data.rb'))
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= camelized %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<%%= csrf_meta_tags %>
|
7
|
+
<%%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%- if options[:skip_hotwire] || options[:skip_javascript] -%>
|
10
|
+
<%%= stylesheet_link_tag "application" %>
|
11
|
+
<%- else -%>
|
12
|
+
<%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
13
|
+
<%- end -%>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<%%= render 'layouts/navbar' %>
|
18
|
+
<%%= render 'layouts/alert' %>
|
19
|
+
<main>
|
20
|
+
<%%= yield %>
|
21
|
+
</main>
|
22
|
+
<%%= render 'layouts/footer' %>
|
23
|
+
</body>
|
24
|
+
</html>
|
File without changes
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Description goes here
|
4
|
+
#
|
5
|
+
# exe/rag addons/test
|
6
|
+
|
7
|
+
self.local_template_path = File.dirname(__FILE__)
|
8
|
+
|
9
|
+
gac 'base rails 7 image created'
|
10
|
+
|
11
|
+
prepare_environment
|
12
|
+
|
13
|
+
add_controller('home', 'index')
|
14
|
+
|
15
|
+
route("root 'home#index'")
|
16
|
+
|
17
|
+
force_copy
|
18
|
+
|
19
|
+
directory "app/controllers"
|
20
|
+
directory "app/views/home"
|
21
|
+
directory "app/views/layouts"
|
22
|
+
template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
23
|
+
|
24
|
+
template 'db/seeds.rb' , 'db/seeds.rb'
|
25
|
+
|
26
|
+
after_bundle do
|
27
|
+
setup_db
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_db
|
31
|
+
# add_scaffold('post', 'title', 'body:text', 'user:references')
|
32
|
+
# add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
|
33
|
+
# add_scaffold('product', 'name', 'price:integer')
|
34
|
+
|
35
|
+
# db_migrate
|
36
|
+
# db_seed
|
37
|
+
end
|
38
|
+
|
39
|
+
# Other template command examples
|
40
|
+
# prepare_environment
|
41
|
+
# bundle_install
|
42
|
+
# css_install('tailwind')
|
43
|
+
# rails_command('db:migrate')
|
44
|
+
# rails_command('db:migrate')
|
45
|
+
# bundle_add('hotwire-rails')
|
46
|
+
# rails_command('hotwire:install')
|
47
|
+
# run('bin/importmap pin sortablejs')
|
48
|
+
# run('npm install daisyui')
|
49
|
+
# rubocop
|
50
|
+
#
|
51
|
+
# directory 'app/assets/images'
|
52
|
+
# create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
|
53
|
+
# append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
|
54
|
+
# insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
|
55
|
+
# before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
|
56
|
+
# gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
|
57
|
+
# template 'home.css', 'app/assets/stylesheets/home.css'
|
58
|
+
#
|
59
|
+
# add_controller('page', 'benefits', 'faq', 'terms', 'privacy', '--skip-routes')
|
60
|
+
# route(<<-'RUBY')
|
61
|
+
# PageController.action_methods.each do |action|
|
62
|
+
# get "/#{action}", to: "page##{action}", as: "page_#{action}"
|
63
|
+
# end
|
64
|
+
# RUBY
|
@@ -0,0 +1 @@
|
|
1
|
+
<hr />
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= camelized %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<%%= csrf_meta_tags %>
|
7
|
+
<%%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%- if options[:skip_hotwire] || options[:skip_javascript] -%>
|
10
|
+
<%%= stylesheet_link_tag "application" %>
|
11
|
+
<%- else -%>
|
12
|
+
<%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
13
|
+
<%- end -%>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<header>
|
18
|
+
<%%= render 'layouts/navbar' %>
|
19
|
+
<hr />
|
20
|
+
</header>
|
21
|
+
<main>
|
22
|
+
<%%= yield %>
|
23
|
+
</main>
|
24
|
+
<footer>
|
25
|
+
<%%= render 'layouts/footer' %>
|
26
|
+
</footer>
|
27
|
+
</body>
|
28
|
+
</html>
|
29
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# david = User.create(email: 'david@site.com', name: 'david', password: 'password')
|
2
|
+
# james = User.create(email: 'james@site.com', name: 'james', password: 'password')
|
3
|
+
# sally = User.create(email: 'sally@site.com', name: 'sally', password: 'password')
|
4
|
+
|
5
|
+
# 10.times do |i|
|
6
|
+
# Post.create(title: "Post #{i}", body: "This is the body of post #{i}", user: User.all.sample)
|
7
|
+
# end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Description goes here
|
4
|
+
#
|
5
|
+
# exe/rag addons/testy
|
6
|
+
|
7
|
+
self.local_template_path = File.dirname(__FILE__)
|
8
|
+
|
9
|
+
gac 'base rails 7 image created'
|
10
|
+
|
11
|
+
prepare_environment
|
12
|
+
|
13
|
+
add_controller('home', 'index')
|
14
|
+
|
15
|
+
route("root 'home#index'")
|
16
|
+
|
17
|
+
force_copy
|
18
|
+
|
19
|
+
directory "app/controllers"
|
20
|
+
directory "app/views/home"
|
21
|
+
directory "app/views/layouts"
|
22
|
+
template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
23
|
+
|
24
|
+
template 'db/seeds.rb' , 'db/seeds.rb'
|
25
|
+
|
26
|
+
after_bundle do
|
27
|
+
setup_db
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_db
|
31
|
+
# add_scaffold('post', 'title', 'body:text', 'user:references')
|
32
|
+
# add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
|
33
|
+
# add_scaffold('product', 'name', 'price:integer')
|
34
|
+
|
35
|
+
# db_migrate
|
36
|
+
# db_seed
|
37
|
+
end
|
38
|
+
|
39
|
+
# Other template command examples
|
40
|
+
# prepare_environment
|
41
|
+
# bundle_install
|
42
|
+
# css_install('tailwind')
|
43
|
+
# rails_command('db:migrate')
|
44
|
+
# rails_command('db:migrate')
|
45
|
+
# bundle_add('hotwire-rails')
|
46
|
+
# rails_command('hotwire:install')
|
47
|
+
# run('bin/importmap pin sortablejs')
|
48
|
+
# run('npm install daisyui')
|
49
|
+
# rubocop
|
50
|
+
#
|
51
|
+
# directory 'app/assets/images'
|
52
|
+
# create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
|
53
|
+
# append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
|
54
|
+
# insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
|
55
|
+
# before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
|
56
|
+
# gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
|
57
|
+
# template 'home.css', 'app/assets/stylesheets/home.css'
|
58
|
+
#
|
59
|
+
# add_controller('page', 'benefits', 'faq', 'terms', 'privacy', '--skip-routes')
|
60
|
+
# route(<<-'RUBY')
|
61
|
+
# PageController.action_methods.each do |action|
|
62
|
+
# get "/#{action}", to: "page##{action}", as: "page_#{action}"
|
63
|
+
# end
|
64
|
+
# RUBY
|
@@ -0,0 +1 @@
|
|
1
|
+
<hr />
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= camelized %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<%%= csrf_meta_tags %>
|
7
|
+
<%%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%- if options[:skip_hotwire] || options[:skip_javascript] -%>
|
10
|
+
<%%= stylesheet_link_tag "application" %>
|
11
|
+
<%- else -%>
|
12
|
+
<%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
13
|
+
<%- end -%>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<header>
|
18
|
+
<%%= render 'layouts/navbar' %>
|
19
|
+
<hr />
|
20
|
+
</header>
|
21
|
+
<main>
|
22
|
+
<%%= yield %>
|
23
|
+
</main>
|
24
|
+
<footer>
|
25
|
+
<%%= render 'layouts/footer' %>
|
26
|
+
</footer>
|
27
|
+
</body>
|
28
|
+
</html>
|
29
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# david = User.create(email: 'david@site.com', name: 'david', password: 'password')
|
2
|
+
# james = User.create(email: 'james@site.com', name: 'james', password: 'password')
|
3
|
+
# sally = User.create(email: 'sally@site.com', name: 'sally', password: 'password')
|
4
|
+
|
5
|
+
# 10.times do |i|
|
6
|
+
# Post.create(title: "Post #{i}", body: "This is the body of post #{i}", user: User.all.sample)
|
7
|
+
# end
|