rails_app_generator 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/after_templates/addons/factory_bot/_.rb +12 -26
- data/after_templates/addons/factory_bot/app/controllers/home_controller.rb +8 -2
- data/after_templates/addons/factory_bot/app/services/seed_service.rb +46 -13
- data/after_templates/addons/factory_bot/app/views/articles/index.html.erb +32 -0
- data/after_templates/addons/factory_bot/app/views/companies/index.html.erb +33 -0
- data/after_templates/addons/factory_bot/app/views/employee_roles/index.html.erb +30 -0
- data/after_templates/addons/factory_bot/app/views/employees/index.html.erb +36 -0
- data/after_templates/addons/factory_bot/app/views/layouts/_navbar.html.erb +15 -8
- data/after_templates/addons/factory_bot/app/views/projects/index.html.erb +36 -0
- data/after_templates/addons/factory_bot/app/views/regions/index.html.erb +29 -0
- data/after_templates/addons/factory_bot/app/views/roles/index.html.erb +29 -0
- data/after_templates/addons/factory_bot/app/views/videos/index.html.erb +31 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a1.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a2.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a3.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a4.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a5.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a6.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a7.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a8.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/a9.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b1.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b2.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b3.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b4.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b5.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b6.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b7.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b8.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/b9.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c1.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c2.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c3.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c4.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c5.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c6.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c7.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c8.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/c9.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/d1.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/d2.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/d3.png +0 -0
- data/after_templates/addons/factory_bot/best-practices/toshima/d4.png +0 -0
- data/after_templates/addons/factory_bot/best_practice.rb +630 -0
- data/after_templates/addons/factory_bot/config/application.rb +39 -0
- data/after_templates/addons/factory_bot/{factories.rb → custom_factories/_examples.rb} +25 -37
- data/after_templates/addons/factory_bot/custom_factories/article.rb +13 -0
- data/after_templates/addons/factory_bot/custom_factories/company.rb +9 -0
- data/after_templates/addons/factory_bot/custom_factories/employee.rb +37 -0
- data/after_templates/addons/factory_bot/custom_factories/project.rb +10 -0
- data/after_templates/addons/factory_bot/custom_factories/region.rb +32 -0
- data/after_templates/addons/factory_bot/custom_factories/role.rb +21 -0
- data/after_templates/addons/factory_bot/custom_factories/user.rb +10 -0
- data/after_templates/addons/factory_bot/custom_factories/video.rb +7 -0
- data/after_templates/addons/rspec/_.rb +61 -0
- data/after_templates/addons/rspec/app/controllers/home_controller.rb +8 -0
- data/after_templates/addons/rspec/app/services/seed_service.rb +31 -0
- data/after_templates/addons/rspec/app/views/home/index.html.erb +3 -0
- data/after_templates/addons/rspec/app/views/layouts/_footer.html.erb +0 -0
- data/after_templates/addons/rspec/app/views/layouts/_navbar.html.erb +5 -0
- data/after_templates/addons/rspec/app/views/layouts/application.html.erb +29 -0
- data/after_templates/addons/rspec/db/seeds.rb +8 -0
- data/docs/last_run/app_generator_class.json +16 -8
- data/docs/last_run/app_generator_data.json +2 -1
- data/docs/last_run/rails_options_class.json +13 -5
- data/docs/last_run/rails_options_data.json +3 -3
- data/lib/rails_app_generator/addons/rspec.rb +7 -1
- data/lib/rails_app_generator/app_generator.rb +6 -9
- data/lib/rails_app_generator/rag_initializer.rb +4 -1
- data/lib/rails_app_generator/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/factory_bot.json +1 -3
- data/profiles/addons/rspec.json +14 -0
- metadata +61 -8
- data/after_templates/addons/factory_bot/factory-create-user.png +0 -0
- data/after_templates/addons/factory_bot/factory-employee-bad.png +0 -0
- data/after_templates/addons/factory_bot/factory-employee-good.png +0 -0
- data/after_templates/addons/factory_bot/factory-role.png +0 -0
- data/after_templates/addons/factory_bot/factory-video.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ceb2efc08d6f164b434c85b95ad2f33648e545d7482fd78ec3678aa50c91b11
|
4
|
+
data.tar.gz: d8380a66709a7907f26cf22db768c714e32cb9058e336207fd19b9f64e76b17f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77a3033aa8900f2f13c7324c864d74acaee2dd3159f47c476f2ff4c7ed5b1ca50f7f8a2c3ef5dd8fdee2199663f1d7afd634d43f655ea9a3b287c39f9d77d87
|
7
|
+
data.tar.gz: 267b51005953b88b77f692ab24693a49b494c66f774f0e0afa0cd7d93613d21694164e17a3b0d7e4a7c9eb1c39d704b924c9b11b67379e8c3f41d57028098ecd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.3.2](https://github.com/klueless-io/rails_app_generator/compare/v0.3.1...v0.3.2) (2022-09-11)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* update factory_bot profile ([aa121e3](https://github.com/klueless-io/rails_app_generator/commit/aa121e35efd88b9ed5704cacf4f348e50e4c7dc2))
|
7
|
+
* update factory_bot profile ([7b5247d](https://github.com/klueless-io/rails_app_generator/commit/7b5247dd44e239ec20eff74dd64be9d5d05d0e72))
|
8
|
+
|
1
9
|
## [0.3.1](https://github.com/klueless-io/rails_app_generator/compare/v0.3.0...v0.3.1) (2022-09-02)
|
2
10
|
|
3
11
|
|
@@ -17,47 +17,33 @@ after_bundle do
|
|
17
17
|
migrate_db
|
18
18
|
end
|
19
19
|
|
20
|
-
# Goals:
|
21
|
-
# - Store Factories in subfolder under spec
|
22
|
-
# -
|
23
|
-
# - Use the faker GEM with both standard and custom data
|
24
|
-
# - Custom data goes in custom locales folder, see: https://stackoverflow.com/questions/28153540/extending-faker-in-a-gem-where-do-i-put-the-yaml-file
|
25
|
-
# - Use associations to affectively create related records
|
26
|
-
# - Create default and NULL factory example
|
27
|
-
# - Create Seed Data services
|
28
|
-
# - Add support for STI
|
29
|
-
# - Add support for polymorphic associations
|
30
|
-
# Things to be aware of in faker
|
31
|
-
# - Random focused data is better then sequence
|
32
|
-
# sequence(:name) { |n| "Category #{n}" }
|
33
|
-
# vs
|
34
|
-
# name { Faker::Hipster.word }
|
35
|
-
# -
|
36
|
-
|
37
|
-
|
38
20
|
def scaffolds
|
39
|
-
add_scaffold('
|
40
|
-
add_scaffold('
|
41
|
-
add_scaffold('role', 'code') # contributor, moderator, admin
|
42
|
-
add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', '
|
43
|
-
add_scaffold('
|
44
|
-
add_scaffold('
|
21
|
+
add_scaffold('region', 'name', 'settings:json')
|
22
|
+
add_scaffold('company', 'name', 'slug', 'active:boolean', 'region:references')
|
23
|
+
add_scaffold('role', 'code', 'description') # contributor, moderator, admin
|
24
|
+
add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', 'company:references')
|
25
|
+
add_scaffold('employee_role', 'employee:references', 'role:references')
|
26
|
+
add_scaffold('project', 'name', 'status', 'budget:decimal', 'country', 'progress:integer', 'company:references')
|
27
|
+
add_scaffold('article', 'title', 'body:text', 'is_featured:boolean', 'published:datetime', 'employee:references', 'company:references')
|
45
28
|
add_scaffold('video', 'title', 'youtube_id', '', 'article:references')
|
29
|
+
add_scaffold('reserved', 'new', 'do', 'end')
|
46
30
|
end
|
47
31
|
|
32
|
+
# https://speakerdeck.com/toshimaru/factorybot-the-right-way
|
48
33
|
def setup_customizations
|
49
34
|
route("root 'home#index'")
|
50
35
|
|
51
36
|
force_copy
|
52
37
|
|
53
|
-
add_controller('home', 'index', '
|
38
|
+
add_controller('home', 'index', 'test_data', 'sample_data')
|
54
39
|
|
55
40
|
directory "app/controllers"
|
56
41
|
directory "app/models"
|
57
42
|
directory "app/views"
|
58
43
|
template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
59
44
|
directory "app/services"
|
60
|
-
|
45
|
+
directory 'config'
|
46
|
+
directory 'custom_factories'
|
61
47
|
end
|
62
48
|
|
63
49
|
def create_db
|
@@ -2,8 +2,14 @@ class HomeController < ApplicationController
|
|
2
2
|
def index
|
3
3
|
end
|
4
4
|
|
5
|
-
def
|
6
|
-
SeedService.seed(variant: :
|
5
|
+
def test_data
|
6
|
+
SeedService.seed(variant: :test_data)
|
7
|
+
|
8
|
+
redirect_back_or_to root_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def seed_data
|
12
|
+
SeedService.seed(variant: :seed_data)
|
7
13
|
|
8
14
|
redirect_back_or_to root_path
|
9
15
|
end
|
@@ -1,35 +1,68 @@
|
|
1
1
|
class SeedService
|
2
|
+
include FactoryBot::Syntax::Methods
|
3
|
+
|
2
4
|
class << self
|
3
|
-
def seed(variant: :
|
5
|
+
def seed(variant: :test_data)
|
4
6
|
service = SeedService.new
|
5
7
|
service.call(variant: variant)
|
6
8
|
end
|
7
9
|
end
|
8
10
|
|
9
11
|
def call(variant: :reset)
|
10
|
-
reset
|
11
|
-
|
12
|
-
|
12
|
+
reset
|
13
|
+
generate_test_data if variant == :test_data
|
14
|
+
generate_sample_data if variant == :sample_data
|
13
15
|
end
|
14
16
|
|
15
17
|
private
|
16
18
|
|
17
19
|
def reset
|
20
|
+
Video.delete_all
|
18
21
|
Article.delete_all
|
19
22
|
Project.delete_all
|
23
|
+
EmployeeRole.delete_all
|
20
24
|
Employee.delete_all
|
21
|
-
|
22
|
-
|
25
|
+
Role.delete_all
|
26
|
+
Company.delete_all
|
27
|
+
Region.delete_all
|
28
|
+
end
|
29
|
+
|
30
|
+
# add_scaffold('region', 'name', 'settings:json')
|
31
|
+
# add_scaffold('company', 'name', 'slug', 'active:boolean', 'region:references')
|
32
|
+
# add_scaffold('role', 'code', 'description') # contributor, moderator, admin
|
33
|
+
# add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', 'company:references')
|
34
|
+
# add_scaffold('employee_role', 'employee:references', 'role:references')
|
35
|
+
# add_scaffold('project', 'name', 'status', 'budget:decimal', 'country', 'progress:integer', 'company:references')
|
36
|
+
# add_scaffold('article', 'title', 'body:text', 'is_featured:boolean', 'published:datetime', 'employee:references', 'company:references')
|
37
|
+
# add_scaffold('video', 'title', 'youtube_id', '', 'article:references')
|
38
|
+
|
39
|
+
def generate_test_data
|
40
|
+
test_data_regions
|
41
|
+
# companies = create_list(:company, rand(3..5))#, region: region)
|
42
|
+
# companies = create_list(:company, rand(3..5))#, region: region)
|
43
|
+
# employees = create_list(:employee, rand(10..20), company: companies.sample)
|
44
|
+
# _articles = create_list(:article, rand(10..20), company: companies.sample, employee: employees.sample)
|
45
|
+
# _projects = create_list(:project, rand(10..20), company: companies.sample)
|
23
46
|
end
|
24
47
|
|
25
|
-
def
|
48
|
+
def generate_sample_data
|
49
|
+
regions = create_list(:region, rand(2..5))
|
50
|
+
companies = create_list(:company, rand(3..5))#, region: region)
|
51
|
+
# companies = create_list(:company, rand(3..5))#, region: region)
|
52
|
+
# employees = create_list(:employee, rand(10..20), company: companies.sample)
|
53
|
+
# _articles = create_list(:article, rand(10..20), company: companies.sample, employee: employees.sample)
|
54
|
+
# _projects = create_list(:project, rand(10..20), company: companies.sample)
|
26
55
|
end
|
27
56
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
57
|
+
private
|
58
|
+
|
59
|
+
def test_data_regions
|
60
|
+
@region_western_sydney = create(:region, :western_sydney)
|
61
|
+
@region_western_sydney2 = create(:region, :western_sydney) # create it again Sam
|
62
|
+
@region_sydney = create(:region, :sydney)
|
63
|
+
@region_eastern_suburbs = create(:region, :eastern_suburbs)
|
64
|
+
@region_inner_west = create(:region, :inner_west)
|
65
|
+
@region_north_shore = create(:region, :north_shore)
|
66
|
+
@regions_random = create_list(:region, 4)
|
34
67
|
end
|
35
68
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Articles</h1>
|
4
|
+
|
5
|
+
<div id="articles">
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>title</th>
|
10
|
+
<th>Youtube ID</th>
|
11
|
+
<th>Article</th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
|
16
|
+
<% @videos.each do |video| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= video.name %></td>
|
19
|
+
<td><%= video.status %></td>
|
20
|
+
<td><%= video.budget %></td>
|
21
|
+
<td><%= video.country %></td>
|
22
|
+
<td><%= video.company&.name %></td>
|
23
|
+
<td><%= link_to "Show", video %></td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
</tbody>
|
28
|
+
</table>
|
29
|
+
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<%= link_to "New article", new_article_path %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Companies</h1>
|
4
|
+
|
5
|
+
<div id="companies">
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Slug</th>
|
12
|
+
<th>Active</th>
|
13
|
+
<th>Region</th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
|
18
|
+
<% @companies.each do |company| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= company.name %></td>
|
21
|
+
<td><%= company.slug %></td>
|
22
|
+
<td><%= company.active %></td>
|
23
|
+
<td><%= company.region&.name %></td>
|
24
|
+
<td><%= link_to "Show", company %></td>
|
25
|
+
</tr>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
</tbody>
|
29
|
+
</table>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<%= link_to "New company", new_company_path %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Employee roles</h1>
|
4
|
+
|
5
|
+
<div id="employee_roles">
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Employee</th>
|
11
|
+
<th>Role</th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
|
16
|
+
<% @employee_roles.each do |employee_role| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= employee_role.employee&.name %></td>
|
19
|
+
<td><%= employee_role.role&.name %></td>
|
20
|
+
<td><%= link_to "Show", employee_role %></td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<%= link_to "New employee role", new_employee_role_path %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Employees</h1>
|
4
|
+
|
5
|
+
<div id="employees">
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>First Name</th>
|
10
|
+
<th>Last Name</th>
|
11
|
+
<th>Address</th>
|
12
|
+
<th>Email</th>
|
13
|
+
<th>Password</th>
|
14
|
+
<th>Company</th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
|
19
|
+
<% @employees.each do |employee| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= employee.first_name %></td>
|
22
|
+
<td><%= employee.last_name %></td>
|
23
|
+
<td><%= employee.address %></td>
|
24
|
+
<td><%= employee.email %></td>
|
25
|
+
<td><%= employee.password %></td>
|
26
|
+
<td><%= employee.company&.name %></td>
|
27
|
+
<td><%= link_to "Show", employee %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%= link_to "New employee", new_employee_path %>
|
@@ -1,10 +1,17 @@
|
|
1
1
|
<%= link_to 'Home', root_path %>
|
2
|
-
| <%= link_to '
|
3
|
-
| <%= link_to '
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
| <%= link_to '
|
8
|
-
| <%= link_to '
|
9
|
-
| <%= link_to '
|
2
|
+
| <%= link_to 'Region', regions_path %>
|
3
|
+
| <%= link_to 'Company', companies_path %>
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
| <%= link_to 'Video', videos_path %>
|
8
|
+
| <%= link_to 'Article', articles_path %>
|
9
|
+
| <%= link_to 'Project', projects_path %>
|
10
|
+
| <%= link_to 'EmployeeRole', employee_roles_path %>
|
11
|
+
| <%= link_to 'Employee', employees_path %>
|
12
|
+
| <%= link_to 'Role', roles_path %>
|
13
|
+
| <%= link_to 'Reserved', reserveds_path %>
|
14
|
+
|
15
|
+
| <%= link_to 'Test Data', home_test_data_path, style: 'color: blue; font-weight: 600;' %>
|
16
|
+
| <%= link_to 'Sample Data', home_sample_data_path, style: 'color: blue; font-weight: 600;' %>
|
10
17
|
<hr />
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Projects</h1>
|
4
|
+
|
5
|
+
<div id="projects">
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>Name</th>
|
10
|
+
<th>Status</th>
|
11
|
+
<th>Budget</th>
|
12
|
+
<th>Country</th>
|
13
|
+
<th>Progress</th>
|
14
|
+
<th>Project</th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
|
19
|
+
<% @projects.each do |project| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= project.name %></td>
|
22
|
+
<td><%= project.status %></td>
|
23
|
+
<td><%= project.budget %></td>
|
24
|
+
<td><%= project.country %></td>
|
25
|
+
<td><%= project.progress %></td>
|
26
|
+
<td><%= project.project&.name %></td>
|
27
|
+
<td><%= link_to "Show", project %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%= link_to "New project", new_project_path %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Regions</h1>
|
4
|
+
|
5
|
+
<div id="regions">
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Settings</th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
|
16
|
+
<% @regions.each do |region| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= region.name %></td>
|
19
|
+
<td><%= region.settings %></td>
|
20
|
+
<td><%= link_to "Show", region %></td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<%= link_to "New region", new_region_path %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Roles</h1>
|
4
|
+
|
5
|
+
<div id="roles">
|
6
|
+
<table>
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>title</th>
|
10
|
+
<th>Youtube ID</th>
|
11
|
+
<th>Article</th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
|
16
|
+
<% @roles.each do |role| %>
|
17
|
+
<tr>
|
18
|
+
<td><%= role.code %></td>
|
19
|
+
<td><%= role.description %></td>
|
20
|
+
<td><%= link_to "Show", role %></td>
|
21
|
+
</tr>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<%= link_to "New role", new_role_path %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<p style="color: green"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Videos</h1>
|
4
|
+
|
5
|
+
<div id="videos">
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>title</th>
|
11
|
+
<th>Youtube ID</th>
|
12
|
+
<th>Article</th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
|
17
|
+
<% @videos.each do |video| %>
|
18
|
+
<tr>
|
19
|
+
<td><%= video.name %></td>
|
20
|
+
<td><%= video.slug %></td>
|
21
|
+
<td><%= video.article&.title %></td>
|
22
|
+
<td><%= link_to "Show", video %></td>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<%= link_to "New video", new_video_path %>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|