Skip to content

Commit b142b1b

Browse files
committed
Added first examples for one-to-one association
1 parent 8d89ea4 commit b142b1b

File tree

116 files changed

+26227
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+26227
-2
lines changed

.gitignore

+71
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/test/tmp/
1010
/test/version_tmp/
1111
/tmp/
12+
/db/development.sqlite3
13+
/db/test.sqlite3*
14+
/node_modules
1215

1316
# Used by dotenv library to load environment variables.
1417
# .env
@@ -48,3 +51,71 @@ build-iPhoneSimulator/
4851

4952
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
5053
.rvmrc
54+
55+
*.rbc
56+
capybara-*.html
57+
.rspec
58+
/db/*.sqlite3
59+
/db/*.sqlite3-journal
60+
/db/*.sqlite3-[0-9]*
61+
/public/system
62+
/coverage/
63+
/spec/tmp
64+
*.orig
65+
rerun.txt
66+
pickle-email-*.html
67+
68+
# Ignore all logfiles and tempfiles.
69+
/log/*
70+
/tmp/*
71+
!/log/.keep
72+
!/tmp/.keep
73+
74+
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
75+
config/initializers/secret_token.rb
76+
config/master.key
77+
78+
# Only include if you have production secrets in this file, which is no longer a Rails default
79+
# config/secrets.yml
80+
81+
# dotenv
82+
# TODO Comment out this rule if environment variables can be committed
83+
.env
84+
85+
## Environment normalization:
86+
/.bundle
87+
/vendor/bundle
88+
89+
# these should all be checked in to normalize the environment:
90+
# Gemfile.lock, .ruby-version, .ruby-gemset
91+
92+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
93+
.rvmrc
94+
95+
# if using bower-rails ignore default bower_components path bower.json files
96+
/vendor/assets/bower_components
97+
*.bowerrc
98+
bower.json
99+
100+
# Ignore pow environment settings
101+
.powenv
102+
103+
# Ignore Byebug command history file.
104+
.byebug_history
105+
106+
# Ignore node_modules
107+
node_modules/
108+
109+
# Ignore precompiled javascript packs
110+
/public/packs
111+
/public/packs-test
112+
/public/assets
113+
114+
# Ignore yarn files
115+
/yarn-error.log
116+
yarn-debug.log*
117+
.yarn-integrity
118+
119+
# Ignore uploaded files in development
120+
/storage/*
121+
!/storage/.keep

Gemfile

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.6.5'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 6.0.1'
8+
# Use sqlite3 as the database for Active Record
9+
gem 'sqlite3', '~> 1.4'
10+
# Use Puma as the app server
11+
gem 'puma', '~> 4.1'
12+
# Use SCSS for stylesheets
13+
gem 'sass-rails', '>= 6'
14+
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
15+
gem 'webpacker', '~> 4.0'
16+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
17+
gem 'turbolinks', '~> 5'
18+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
19+
gem 'jbuilder', '~> 2.7'
20+
# Use Redis adapter to run Action Cable in production
21+
# gem 'redis', '~> 4.0'
22+
# Use Active Model has_secure_password
23+
# gem 'bcrypt', '~> 3.1.7'
24+
25+
# Use Active Storage variant
26+
# gem 'image_processing', '~> 1.2'
27+
28+
gem 'simple_form'
29+
30+
# Reduces boot times through caching; required in config/boot.rb
31+
gem 'bootsnap', '>= 1.4.2', require: false
32+
33+
group :development, :test do
34+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
35+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
36+
end
37+
38+
group :development do
39+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
40+
gem 'web-console', '>= 3.3.0'
41+
gem 'listen', '>= 3.0.5', '< 3.2'
42+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
43+
gem 'spring'
44+
gem 'spring-watcher-listen', '~> 2.0.0'
45+
end
46+
47+
group :test do
48+
# Adds support for Capybara system testing and selenium driver
49+
gem 'capybara', '>= 2.15'
50+
gem 'selenium-webdriver'
51+
# Easy installation and use of web drivers to run system tests with browsers
52+
gem 'webdrivers'
53+
end
54+
55+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
56+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

+229
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (6.0.1)
5+
actionpack (= 6.0.1)
6+
nio4r (~> 2.0)
7+
websocket-driver (>= 0.6.1)
8+
actionmailbox (6.0.1)
9+
actionpack (= 6.0.1)
10+
activejob (= 6.0.1)
11+
activerecord (= 6.0.1)
12+
activestorage (= 6.0.1)
13+
activesupport (= 6.0.1)
14+
mail (>= 2.7.1)
15+
actionmailer (6.0.1)
16+
actionpack (= 6.0.1)
17+
actionview (= 6.0.1)
18+
activejob (= 6.0.1)
19+
mail (~> 2.5, >= 2.5.4)
20+
rails-dom-testing (~> 2.0)
21+
actionpack (6.0.1)
22+
actionview (= 6.0.1)
23+
activesupport (= 6.0.1)
24+
rack (~> 2.0)
25+
rack-test (>= 0.6.3)
26+
rails-dom-testing (~> 2.0)
27+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
28+
actiontext (6.0.1)
29+
actionpack (= 6.0.1)
30+
activerecord (= 6.0.1)
31+
activestorage (= 6.0.1)
32+
activesupport (= 6.0.1)
33+
nokogiri (>= 1.8.5)
34+
actionview (6.0.1)
35+
activesupport (= 6.0.1)
36+
builder (~> 3.1)
37+
erubi (~> 1.4)
38+
rails-dom-testing (~> 2.0)
39+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
40+
activejob (6.0.1)
41+
activesupport (= 6.0.1)
42+
globalid (>= 0.3.6)
43+
activemodel (6.0.1)
44+
activesupport (= 6.0.1)
45+
activerecord (6.0.1)
46+
activemodel (= 6.0.1)
47+
activesupport (= 6.0.1)
48+
activestorage (6.0.1)
49+
actionpack (= 6.0.1)
50+
activejob (= 6.0.1)
51+
activerecord (= 6.0.1)
52+
marcel (~> 0.3.1)
53+
activesupport (6.0.1)
54+
concurrent-ruby (~> 1.0, >= 1.0.2)
55+
i18n (>= 0.7, < 2)
56+
minitest (~> 5.1)
57+
tzinfo (~> 1.1)
58+
zeitwerk (~> 2.2)
59+
addressable (2.7.0)
60+
public_suffix (>= 2.0.2, < 5.0)
61+
bindex (0.8.1)
62+
bootsnap (1.4.5)
63+
msgpack (~> 1.0)
64+
builder (3.2.3)
65+
byebug (11.0.1)
66+
capybara (3.29.0)
67+
addressable
68+
mini_mime (>= 0.1.3)
69+
nokogiri (~> 1.8)
70+
rack (>= 1.6.0)
71+
rack-test (>= 0.6.3)
72+
regexp_parser (~> 1.5)
73+
xpath (~> 3.2)
74+
childprocess (3.0.0)
75+
concurrent-ruby (1.1.5)
76+
crass (1.0.5)
77+
erubi (1.9.0)
78+
ffi (1.11.3)
79+
globalid (0.4.2)
80+
activesupport (>= 4.2.0)
81+
i18n (1.7.0)
82+
concurrent-ruby (~> 1.0)
83+
jbuilder (2.9.1)
84+
activesupport (>= 4.2.0)
85+
listen (3.1.5)
86+
rb-fsevent (~> 0.9, >= 0.9.4)
87+
rb-inotify (~> 0.9, >= 0.9.7)
88+
ruby_dep (~> 1.2)
89+
loofah (2.4.0)
90+
crass (~> 1.0.2)
91+
nokogiri (>= 1.5.9)
92+
mail (2.7.1)
93+
mini_mime (>= 0.1.1)
94+
marcel (0.3.3)
95+
mimemagic (~> 0.3.2)
96+
method_source (0.9.2)
97+
mimemagic (0.3.3)
98+
mini_mime (1.0.2)
99+
mini_portile2 (2.4.0)
100+
minitest (5.13.0)
101+
msgpack (1.3.1)
102+
nio4r (2.5.2)
103+
nokogiri (1.10.5)
104+
mini_portile2 (~> 2.4.0)
105+
public_suffix (4.0.1)
106+
puma (4.3.0)
107+
nio4r (~> 2.0)
108+
rack (2.0.7)
109+
rack-proxy (0.6.5)
110+
rack
111+
rack-test (1.1.0)
112+
rack (>= 1.0, < 3)
113+
rails (6.0.1)
114+
actioncable (= 6.0.1)
115+
actionmailbox (= 6.0.1)
116+
actionmailer (= 6.0.1)
117+
actionpack (= 6.0.1)
118+
actiontext (= 6.0.1)
119+
actionview (= 6.0.1)
120+
activejob (= 6.0.1)
121+
activemodel (= 6.0.1)
122+
activerecord (= 6.0.1)
123+
activestorage (= 6.0.1)
124+
activesupport (= 6.0.1)
125+
bundler (>= 1.3.0)
126+
railties (= 6.0.1)
127+
sprockets-rails (>= 2.0.0)
128+
rails-dom-testing (2.0.3)
129+
activesupport (>= 4.2.0)
130+
nokogiri (>= 1.6)
131+
rails-html-sanitizer (1.3.0)
132+
loofah (~> 2.3)
133+
railties (6.0.1)
134+
actionpack (= 6.0.1)
135+
activesupport (= 6.0.1)
136+
method_source
137+
rake (>= 0.8.7)
138+
thor (>= 0.20.3, < 2.0)
139+
rake (13.0.1)
140+
rb-fsevent (0.10.3)
141+
rb-inotify (0.10.0)
142+
ffi (~> 1.0)
143+
regexp_parser (1.6.0)
144+
ruby_dep (1.5.0)
145+
rubyzip (2.0.0)
146+
sass-rails (6.0.0)
147+
sassc-rails (~> 2.1, >= 2.1.1)
148+
sassc (2.2.1)
149+
ffi (~> 1.9)
150+
sassc-rails (2.1.2)
151+
railties (>= 4.0.0)
152+
sassc (>= 2.0)
153+
sprockets (> 3.0)
154+
sprockets-rails
155+
tilt
156+
selenium-webdriver (3.142.6)
157+
childprocess (>= 0.5, < 4.0)
158+
rubyzip (>= 1.2.2)
159+
simple_form (5.0.1)
160+
actionpack (>= 5.0)
161+
activemodel (>= 5.0)
162+
spring (2.1.0)
163+
spring-watcher-listen (2.0.1)
164+
listen (>= 2.7, < 4.0)
165+
spring (>= 1.2, < 3.0)
166+
sprockets (4.0.0)
167+
concurrent-ruby (~> 1.0)
168+
rack (> 1, < 3)
169+
sprockets-rails (3.2.1)
170+
actionpack (>= 4.0)
171+
activesupport (>= 4.0)
172+
sprockets (>= 3.0.0)
173+
sqlite3 (1.4.1)
174+
thor (0.20.3)
175+
thread_safe (0.3.6)
176+
tilt (2.0.10)
177+
turbolinks (5.2.1)
178+
turbolinks-source (~> 5.2)
179+
turbolinks-source (5.2.0)
180+
tzinfo (1.2.5)
181+
thread_safe (~> 0.1)
182+
web-console (4.0.1)
183+
actionview (>= 6.0.0)
184+
activemodel (>= 6.0.0)
185+
bindex (>= 0.4.0)
186+
railties (>= 6.0.0)
187+
webdrivers (4.1.3)
188+
nokogiri (~> 1.6)
189+
rubyzip (>= 1.3.0)
190+
selenium-webdriver (>= 3.0, < 4.0)
191+
webpacker (4.2.0)
192+
activesupport (>= 4.2)
193+
rack-proxy (>= 0.6.1)
194+
railties (>= 4.2)
195+
websocket-driver (0.7.1)
196+
websocket-extensions (>= 0.1.0)
197+
websocket-extensions (0.1.4)
198+
xpath (3.2.0)
199+
nokogiri (~> 1.8)
200+
zeitwerk (2.2.2)
201+
202+
PLATFORMS
203+
ruby
204+
205+
DEPENDENCIES
206+
bootsnap (>= 1.4.2)
207+
byebug
208+
capybara (>= 2.15)
209+
jbuilder (~> 2.7)
210+
listen (>= 3.0.5, < 3.2)
211+
puma (~> 4.1)
212+
rails (~> 6.0.1)
213+
sass-rails (>= 6)
214+
selenium-webdriver
215+
simple_form
216+
spring
217+
spring-watcher-listen (~> 2.0.0)
218+
sqlite3 (~> 1.4)
219+
turbolinks (~> 5)
220+
tzinfo-data
221+
web-console (>= 3.3.0)
222+
webdrivers
223+
webpacker (~> 4.0)
224+
225+
RUBY VERSION
226+
ruby 2.6.5p114
227+
228+
BUNDLED WITH
229+
2.0.2

README.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1-
# rails-nested-forms-examples
2-
Examples to used nested form with different types of associations
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

0 commit comments

Comments
 (0)