rails 4.0.0 → 4.2.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +30 -23
- data/guides/CHANGELOG.md +108 -6
- data/guides/Rakefile +21 -6
- data/guides/assets/images/akshaysurve.jpg +0 -0
- data/guides/assets/images/edge_badge.png +0 -0
- data/guides/assets/images/feature_tile.gif +0 -0
- data/guides/assets/images/footer_tile.gif +0 -0
- data/guides/assets/images/fxn.png +0 -0
- data/guides/assets/images/getting_started/article_with_comments.png +0 -0
- data/guides/assets/images/getting_started/challenge.png +0 -0
- data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
- data/guides/assets/images/getting_started/form_with_errors.png +0 -0
- data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
- data/guides/assets/images/getting_started/new_article.png +0 -0
- data/guides/assets/images/getting_started/rails_welcome.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
- data/guides/assets/images/header_tile.gif +0 -0
- data/guides/assets/images/icons/README +1 -1
- data/guides/assets/images/icons/callouts/11.png +0 -0
- data/guides/assets/images/icons/callouts/12.png +0 -0
- data/guides/assets/images/icons/callouts/13.png +0 -0
- data/guides/assets/images/icons/callouts/15.png +0 -0
- data/guides/assets/images/icons/caution.png +0 -0
- data/guides/assets/images/icons/example.png +0 -0
- data/guides/assets/images/radar.png +0 -0
- data/guides/assets/images/rails4_features.png +0 -0
- data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
- data/guides/assets/images/vijaydev.jpg +0 -0
- data/guides/assets/javascripts/guides.js +36 -34
- data/guides/assets/stylesheets/main.css +6 -2
- data/guides/assets/stylesheets/print.css +1 -1
- data/guides/bug_report_templates/action_controller_gem.rb +47 -0
- data/guides/bug_report_templates/action_controller_master.rb +54 -0
- data/guides/bug_report_templates/active_record_gem.rb +5 -2
- data/guides/bug_report_templates/active_record_master.rb +3 -2
- data/guides/bug_report_templates/generic_gem.rb +15 -0
- data/guides/bug_report_templates/generic_master.rb +26 -0
- data/guides/rails_guides.rb +23 -4
- data/guides/rails_guides/generator.rb +1 -1
- data/guides/rails_guides/helpers.rb +4 -2
- data/guides/rails_guides/levenshtein.rb +27 -21
- data/guides/rails_guides/markdown.rb +11 -7
- data/guides/rails_guides/markdown/renderer.rb +1 -1
- data/guides/source/2_2_release_notes.md +3 -3
- data/guides/source/2_3_release_notes.md +12 -12
- data/guides/source/3_0_release_notes.md +10 -13
- data/guides/source/3_1_release_notes.md +7 -4
- data/guides/source/3_2_release_notes.md +17 -14
- data/guides/source/4_0_release_notes.md +110 -54
- data/guides/source/4_1_release_notes.md +730 -0
- data/guides/source/4_2_release_notes.md +877 -0
- data/guides/source/_license.html.erb +1 -1
- data/guides/source/_welcome.html.erb +6 -2
- data/guides/source/action_controller_overview.md +223 -57
- data/guides/source/action_mailer_basics.md +129 -76
- data/guides/source/action_view_overview.md +247 -246
- data/guides/source/active_job_basics.md +339 -0
- data/guides/source/active_model_basics.md +374 -20
- data/guides/source/active_record_basics.md +46 -45
- data/guides/source/active_record_callbacks.md +83 -28
- data/guides/source/{migrations.md → active_record_migrations.md} +191 -275
- data/guides/source/active_record_postgresql.md +433 -0
- data/guides/source/active_record_querying.md +382 -300
- data/guides/source/active_record_validations.md +64 -55
- data/guides/source/active_support_core_extensions.md +229 -187
- data/guides/source/active_support_instrumentation.md +23 -22
- data/guides/source/api_documentation_guidelines.md +167 -15
- data/guides/source/asset_pipeline.md +768 -294
- data/guides/source/association_basics.md +188 -96
- data/guides/source/autoloading_and_reloading_constants.md +1311 -0
- data/guides/source/caching_with_rails.md +45 -11
- data/guides/source/command_line.md +96 -65
- data/guides/source/configuring.md +404 -70
- data/guides/source/contributing_to_ruby_on_rails.md +270 -130
- data/guides/source/credits.html.erb +7 -3
- data/guides/source/debugging_rails_applications.md +471 -284
- data/guides/source/development_dependencies_install.md +115 -21
- data/guides/source/documents.yaml +31 -9
- data/guides/source/engines.md +737 -291
- data/guides/source/form_helpers.md +137 -89
- data/guides/source/generators.md +60 -28
- data/guides/source/getting_started.md +1007 -596
- data/guides/source/i18n.md +178 -96
- data/guides/source/index.html.erb +2 -1
- data/guides/source/initialization.md +248 -104
- data/guides/source/kindle/toc.html.erb +1 -1
- data/guides/source/layout.html.erb +14 -22
- data/guides/source/layouts_and_rendering.md +78 -46
- data/guides/source/maintenance_policy.md +78 -0
- data/guides/source/nested_model_forms.md +10 -7
- data/guides/source/plugins.md +66 -57
- data/guides/source/rails_application_templates.md +49 -12
- data/guides/source/rails_on_rack.md +50 -60
- data/guides/source/routing.md +190 -139
- data/guides/source/ruby_on_rails_guides_guidelines.md +12 -13
- data/guides/source/security.md +134 -83
- data/guides/source/testing.md +322 -200
- data/guides/source/upgrading_ruby_on_rails.md +834 -37
- data/guides/source/working_with_javascript_in_rails.md +36 -26
- data/guides/w3c_validator.rb +2 -0
- metadata +93 -116
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
- data/guides/assets/images/getting_started/new_post.png +0 -0
- data/guides/assets/images/getting_started/post_with_comments.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_posts.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
- data/guides/assets/images/getting_started/undefined_method_post_path.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
- data/guides/assets/images/jaimeiniesta.jpg +0 -0
- data/guides/code/getting_started/Gemfile +0 -43
- data/guides/code/getting_started/Gemfile.lock +0 -150
- data/guides/code/getting_started/README.rdoc +0 -28
- data/guides/code/getting_started/Rakefile +0 -6
- data/guides/code/getting_started/app/assets/javascripts/application.js +0 -16
- data/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/application.css +0 -13
- data/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +0 -3
- data/guides/code/getting_started/app/controllers/application_controller.rb +0 -5
- data/guides/code/getting_started/app/controllers/comments_controller.rb +0 -17
- data/guides/code/getting_started/app/controllers/posts_controller.rb +0 -47
- data/guides/code/getting_started/app/controllers/welcome_controller.rb +0 -4
- data/guides/code/getting_started/app/helpers/application_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/comments_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/posts_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/welcome_helper.rb +0 -2
- data/guides/code/getting_started/app/models/comment.rb +0 -3
- data/guides/code/getting_started/app/models/post.rb +0 -7
- data/guides/code/getting_started/app/views/comments/_comment.html.erb +0 -15
- data/guides/code/getting_started/app/views/comments/_form.html.erb +0 -13
- data/guides/code/getting_started/app/views/layouts/application.html.erb +0 -14
- data/guides/code/getting_started/app/views/posts/_form.html.erb +0 -27
- data/guides/code/getting_started/app/views/posts/edit.html.erb +0 -5
- data/guides/code/getting_started/app/views/posts/index.html.erb +0 -21
- data/guides/code/getting_started/app/views/posts/new.html.erb +0 -5
- data/guides/code/getting_started/app/views/posts/show.html.erb +0 -18
- data/guides/code/getting_started/app/views/welcome/index.html.erb +0 -3
- data/guides/code/getting_started/bin/bundle +0 -4
- data/guides/code/getting_started/bin/rails +0 -4
- data/guides/code/getting_started/bin/rake +0 -4
- data/guides/code/getting_started/config.ru +0 -4
- data/guides/code/getting_started/config/application.rb +0 -18
- data/guides/code/getting_started/config/boot.rb +0 -4
- data/guides/code/getting_started/config/database.yml +0 -25
- data/guides/code/getting_started/config/environment.rb +0 -5
- data/guides/code/getting_started/config/environments/development.rb +0 -30
- data/guides/code/getting_started/config/environments/production.rb +0 -80
- data/guides/code/getting_started/config/environments/test.rb +0 -36
- data/guides/code/getting_started/config/initializers/backtrace_silencers.rb +0 -7
- data/guides/code/getting_started/config/initializers/filter_parameter_logging.rb +0 -4
- data/guides/code/getting_started/config/initializers/inflections.rb +0 -16
- data/guides/code/getting_started/config/initializers/locale.rb +0 -9
- data/guides/code/getting_started/config/initializers/mime_types.rb +0 -5
- data/guides/code/getting_started/config/initializers/secret_token.rb +0 -12
- data/guides/code/getting_started/config/initializers/session_store.rb +0 -3
- data/guides/code/getting_started/config/initializers/wrap_parameters.rb +0 -14
- data/guides/code/getting_started/config/locales/en.yml +0 -23
- data/guides/code/getting_started/config/routes.rb +0 -7
- data/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb +0 -10
- data/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb +0 -11
- data/guides/code/getting_started/db/schema.rb +0 -33
- data/guides/code/getting_started/db/seeds.rb +0 -7
- data/guides/code/getting_started/public/404.html +0 -58
- data/guides/code/getting_started/public/422.html +0 -58
- data/guides/code/getting_started/public/500.html +0 -57
- data/guides/code/getting_started/public/favicon.ico +0 -0
- data/guides/code/getting_started/public/robots.txt +0 -5
- data/guides/code/getting_started/test/controllers/comments_controller_test.rb +0 -7
- data/guides/code/getting_started/test/controllers/posts_controller_test.rb +0 -7
- data/guides/code/getting_started/test/controllers/welcome_controller_test.rb +0 -9
- data/guides/code/getting_started/test/fixtures/comments.yml +0 -11
- data/guides/code/getting_started/test/fixtures/posts.yml +0 -9
- data/guides/code/getting_started/test/helpers/comments_helper_test.rb +0 -4
- data/guides/code/getting_started/test/helpers/posts_helper_test.rb +0 -4
- data/guides/code/getting_started/test/helpers/welcome_helper_test.rb +0 -4
- data/guides/code/getting_started/test/models/comment_test.rb +0 -7
- data/guides/code/getting_started/test/models/post_test.rb +0 -7
- data/guides/code/getting_started/test/test_helper.rb +0 -15
- data/guides/source/kindle/KINDLE.md +0 -26
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,43 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'rails', '4.0.0'
|
4
|
-
|
5
|
-
# Use sqlite3 as the database for Active Record
|
6
|
-
gem 'sqlite3'
|
7
|
-
|
8
|
-
# Use SCSS for stylesheets
|
9
|
-
gem 'sass-rails'
|
10
|
-
|
11
|
-
# Use CoffeeScript for .js.coffee assets and views
|
12
|
-
gem 'coffee-rails'
|
13
|
-
|
14
|
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
15
|
-
# gem 'therubyracer', platforms: :ruby
|
16
|
-
|
17
|
-
# Use Uglifier as compressor for JavaScript assets
|
18
|
-
gem 'uglifier', '>= 1.0.3'
|
19
|
-
|
20
|
-
gem 'jquery-rails'
|
21
|
-
|
22
|
-
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
23
|
-
gem 'turbolinks'
|
24
|
-
|
25
|
-
group :doc do
|
26
|
-
# bundle exec rake doc:rails generates the API under doc/api.
|
27
|
-
gem 'sdoc', require: false
|
28
|
-
end
|
29
|
-
|
30
|
-
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
31
|
-
gem 'jbuilder', '~> 1.2'
|
32
|
-
|
33
|
-
# To use ActiveModel has_secure_password
|
34
|
-
# gem 'bcrypt-ruby', '~> 3.0.0'
|
35
|
-
|
36
|
-
# Use unicorn as the app server
|
37
|
-
# gem 'unicorn'
|
38
|
-
|
39
|
-
# Deploy with Capistrano
|
40
|
-
# gem 'capistrano', group: :development
|
41
|
-
|
42
|
-
# To use debugger
|
43
|
-
# gem 'debugger'
|
@@ -1,150 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/rails/activerecord-deprecated_finders.git
|
3
|
-
revision: 2e7b35d7948cefb2bba96438873d7f7bb1961a03
|
4
|
-
specs:
|
5
|
-
activerecord-deprecated_finders (0.0.2)
|
6
|
-
|
7
|
-
GIT
|
8
|
-
remote: git://github.com/rails/arel.git
|
9
|
-
revision: 38d0a222e275d917a2c1d093b24457bafb600a00
|
10
|
-
specs:
|
11
|
-
arel (3.0.2.20120819075748)
|
12
|
-
|
13
|
-
GIT
|
14
|
-
remote: git://github.com/rails/coffee-rails.git
|
15
|
-
revision: 052634e6d02d4800d7b021201cc8d5829775b3cd
|
16
|
-
specs:
|
17
|
-
coffee-rails (4.0.0.beta)
|
18
|
-
coffee-script (>= 2.2.0)
|
19
|
-
railties (>= 4.0.0.beta, < 5.0)
|
20
|
-
|
21
|
-
GIT
|
22
|
-
remote: git://github.com/rails/sass-rails.git
|
23
|
-
revision: ae8138a89cac397c0df903dd533e2862902ce8f5
|
24
|
-
specs:
|
25
|
-
sass-rails (4.0.0.beta)
|
26
|
-
railties (>= 4.0.0.beta, < 5.0)
|
27
|
-
sass (>= 3.1.10)
|
28
|
-
sprockets-rails (~> 2.0.0.rc0)
|
29
|
-
tilt (~> 1.3)
|
30
|
-
|
31
|
-
GIT
|
32
|
-
remote: git://github.com/rails/sprockets-rails.git
|
33
|
-
revision: 09917104fdb42245fe369612a7b0e3d77e1ba763
|
34
|
-
specs:
|
35
|
-
sprockets-rails (2.0.0.rc1)
|
36
|
-
actionpack (>= 3.0)
|
37
|
-
activesupport (>= 3.0)
|
38
|
-
sprockets (~> 2.8)
|
39
|
-
|
40
|
-
PATH
|
41
|
-
remote: /Users/steve/src/rails
|
42
|
-
specs:
|
43
|
-
actionmailer (4.0.0.beta)
|
44
|
-
actionpack (= 4.0.0.beta)
|
45
|
-
mail (~> 2.5.3)
|
46
|
-
actionpack (4.0.0.beta)
|
47
|
-
activesupport (= 4.0.0.beta)
|
48
|
-
builder (~> 3.1.0)
|
49
|
-
erubis (~> 2.7.0)
|
50
|
-
rack (~> 1.4.3)
|
51
|
-
rack-test (~> 0.6.1)
|
52
|
-
activemodel (4.0.0.beta)
|
53
|
-
activesupport (= 4.0.0.beta)
|
54
|
-
builder (~> 3.1.0)
|
55
|
-
activerecord (4.0.0.beta)
|
56
|
-
activemodel (= 4.0.0.beta)
|
57
|
-
activerecord-deprecated_finders (= 0.0.2)
|
58
|
-
activesupport (= 4.0.0.beta)
|
59
|
-
arel (~> 3.0.2)
|
60
|
-
activesupport (4.0.0.beta)
|
61
|
-
i18n (~> 0.6)
|
62
|
-
minitest (~> 4.1)
|
63
|
-
multi_json (~> 1.3)
|
64
|
-
thread_safe (~> 0.1)
|
65
|
-
tzinfo (~> 0.3.33)
|
66
|
-
rails (4.0.0.beta)
|
67
|
-
actionmailer (= 4.0.0.beta)
|
68
|
-
actionpack (= 4.0.0.beta)
|
69
|
-
activerecord (= 4.0.0.beta)
|
70
|
-
activesupport (= 4.0.0.beta)
|
71
|
-
bundler (>= 1.2.2, < 2.0)
|
72
|
-
railties (= 4.0.0.beta)
|
73
|
-
sprockets-rails (~> 2.0.0.rc1)
|
74
|
-
railties (4.0.0.beta)
|
75
|
-
actionpack (= 4.0.0.beta)
|
76
|
-
activesupport (= 4.0.0.beta)
|
77
|
-
rake (>= 0.8.7)
|
78
|
-
rdoc (~> 3.4)
|
79
|
-
thor (>= 0.15.4, < 2.0)
|
80
|
-
|
81
|
-
GEM
|
82
|
-
remote: https://rubygems.org/
|
83
|
-
specs:
|
84
|
-
atomic (1.0.1)
|
85
|
-
builder (3.1.4)
|
86
|
-
coffee-script (2.2.0)
|
87
|
-
coffee-script-source
|
88
|
-
execjs
|
89
|
-
coffee-script-source (1.4.0)
|
90
|
-
erubis (2.7.0)
|
91
|
-
execjs (1.4.0)
|
92
|
-
multi_json (~> 1.0)
|
93
|
-
hike (1.2.1)
|
94
|
-
i18n (0.6.1)
|
95
|
-
jbuilder (1.3.0)
|
96
|
-
activesupport (>= 3.0.0)
|
97
|
-
jquery-rails (2.2.0)
|
98
|
-
railties (>= 3.0, < 5.0)
|
99
|
-
thor (>= 0.14, < 2.0)
|
100
|
-
json (1.7.6)
|
101
|
-
mail (2.5.3)
|
102
|
-
i18n (>= 0.4.0)
|
103
|
-
mime-types (~> 1.16)
|
104
|
-
treetop (~> 1.4.8)
|
105
|
-
mime-types (1.19)
|
106
|
-
minitest (4.4.0)
|
107
|
-
multi_json (1.5.0)
|
108
|
-
polyglot (0.3.3)
|
109
|
-
rack (1.4.4)
|
110
|
-
rack-test (0.6.2)
|
111
|
-
rack (>= 1.0)
|
112
|
-
rake (10.0.3)
|
113
|
-
rdoc (3.12)
|
114
|
-
json (~> 1.4)
|
115
|
-
sass (3.2.5)
|
116
|
-
sprockets (2.8.2)
|
117
|
-
hike (~> 1.2)
|
118
|
-
multi_json (~> 1.0)
|
119
|
-
rack (~> 1.0)
|
120
|
-
tilt (~> 1.1, != 1.3.0)
|
121
|
-
sqlite3 (1.3.7)
|
122
|
-
thor (0.16.0)
|
123
|
-
thread_safe (0.1.0)
|
124
|
-
atomic
|
125
|
-
tilt (1.3.3)
|
126
|
-
treetop (1.4.12)
|
127
|
-
polyglot
|
128
|
-
polyglot (>= 0.3.1)
|
129
|
-
turbolinks (1.0.0)
|
130
|
-
coffee-rails
|
131
|
-
tzinfo (0.3.35)
|
132
|
-
uglifier (1.3.0)
|
133
|
-
execjs (>= 0.3.0)
|
134
|
-
multi_json (~> 1.0, >= 1.0.2)
|
135
|
-
|
136
|
-
PLATFORMS
|
137
|
-
ruby
|
138
|
-
|
139
|
-
DEPENDENCIES
|
140
|
-
activerecord-deprecated_finders!
|
141
|
-
arel!
|
142
|
-
coffee-rails!
|
143
|
-
jbuilder (~> 1.0.1)
|
144
|
-
jquery-rails
|
145
|
-
rails!
|
146
|
-
sass-rails!
|
147
|
-
sprockets-rails!
|
148
|
-
sqlite3
|
149
|
-
turbolinks
|
150
|
-
uglifier (>= 1.0.3)
|
@@ -1,28 +0,0 @@
|
|
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
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
-
// GO AFTER THE REQUIRES BELOW.
|
12
|
-
//
|
13
|
-
//= require jquery
|
14
|
-
//= require jquery_ujs
|
15
|
-
//= require turbolinks
|
16
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
-
*
|
11
|
-
*= require_self
|
12
|
-
*= require_tree .
|
13
|
-
*/
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CommentsController < ApplicationController
|
2
|
-
|
3
|
-
http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy
|
4
|
-
|
5
|
-
def create
|
6
|
-
@post = Post.find(params[:post_id])
|
7
|
-
@comment = @post.comments.create(params[:comment].permit(:commenter, :body))
|
8
|
-
redirect_to post_path(@post)
|
9
|
-
end
|
10
|
-
|
11
|
-
def destroy
|
12
|
-
@post = Post.find(params[:post_id])
|
13
|
-
@comment = @post.comments.find(params[:id])
|
14
|
-
@comment.destroy
|
15
|
-
redirect_to post_path(@post)
|
16
|
-
end
|
17
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
class PostsController < ApplicationController
|
2
|
-
|
3
|
-
http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show]
|
4
|
-
|
5
|
-
def index
|
6
|
-
@posts = Post.all
|
7
|
-
end
|
8
|
-
|
9
|
-
def show
|
10
|
-
@post = Post.find(params[:id])
|
11
|
-
end
|
12
|
-
|
13
|
-
def edit
|
14
|
-
@post = Post.find(params[:id])
|
15
|
-
end
|
16
|
-
|
17
|
-
def update
|
18
|
-
@post = Post.find(params[:id])
|
19
|
-
|
20
|
-
if @post.update(params[:post].permit(:title, :text))
|
21
|
-
redirect_to action: :show, id: @post.id
|
22
|
-
else
|
23
|
-
render 'edit'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def new
|
28
|
-
@post = Post.new
|
29
|
-
end
|
30
|
-
|
31
|
-
def create
|
32
|
-
@post = Post.new(params[:post].permit(:title, :text))
|
33
|
-
|
34
|
-
if @post.save
|
35
|
-
redirect_to action: :show, id: @post.id
|
36
|
-
else
|
37
|
-
render 'new'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def destroy
|
42
|
-
@post = Post.find(params[:id])
|
43
|
-
@post.destroy
|
44
|
-
|
45
|
-
redirect_to action: :index
|
46
|
-
end
|
47
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<p>
|
2
|
-
<strong>Commenter:</strong>
|
3
|
-
<%= comment.commenter %>
|
4
|
-
</p>
|
5
|
-
|
6
|
-
<p>
|
7
|
-
<strong>Comment:</strong>
|
8
|
-
<%= comment.body %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<p>
|
12
|
-
<%= link_to 'Destroy Comment', [comment.post, comment],
|
13
|
-
method: :delete,
|
14
|
-
data: { confirm: 'Are you sure?' } %>
|
15
|
-
</p>
|