archerplume 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +45 -0
- data/Gemfile.lock +118 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/README.rdoc +28 -0
- data/Rakefile +6 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/javascripts/application.js +16 -0
- data/app/assets/javascripts/articles.js.coffee +3 -0
- data/app/assets/javascripts/comments.js.coffee +3 -0
- data/app/assets/javascripts/welcome.js.coffee +3 -0
- data/app/assets/stylesheets/application.css +18 -0
- data/app/assets/stylesheets/articles.css.scss +3 -0
- data/app/assets/stylesheets/comments.css.scss +3 -0
- data/app/assets/stylesheets/welcome.css.scss +6 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/articles_controller.rb +50 -0
- data/app/controllers/comments_controller.rb +21 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/welcome_controller.rb +4 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/articles_helper.rb +2 -0
- data/app/helpers/comments_helper.rb +2 -0
- data/app/helpers/welcome_helper.rb +2 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/models/article.rb +5 -0
- data/app/models/comment.rb +3 -0
- data/app/models/concerns/.keep +0 -0
- data/app/views/articles/_form.html.erb +24 -0
- data/app/views/articles/edit.html.erb +3 -0
- data/app/views/articles/index.html.erb +18 -0
- data/app/views/articles/new.html.erb +27 -0
- data/app/views/articles/show.html.erb +26 -0
- data/app/views/comments/_comment.html.erb +13 -0
- data/app/views/comments/_form.html.erb +27 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/app/views/welcome/index.html.erb +1 -0
- data/archerplume.gemspec +23 -0
- data/bin/bundle +3 -0
- data/bin/rails +4 -0
- data/bin/rake +4 -0
- data/config/application.rb +23 -0
- data/config/boot.rb +4 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +29 -0
- data/config/environments/production.rb +80 -0
- data/config/environments/test.rb +36 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +12 -0
- data/config/initializers/session_store.rb +3 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/en.yml +23 -0
- data/config/routes.rb +62 -0
- data/config.ru +4 -0
- data/db/migrate/20140619134507_create_articles.rb +10 -0
- data/db/migrate/20140619143648_create_comments.rb +11 -0
- data/db/schema.rb +33 -0
- data/db/seeds.rb +7 -0
- data/doc/api/created.rid +0 -0
- data/lib/archerplume/version.rb +3 -0
- data/lib/archerplume.rb +5 -0
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/log/.keep +0 -0
- data/public/404.html +58 -0
- data/public/422.html +58 -0
- data/public/500.html +57 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +5 -0
- data/test/controllers/.keep +0 -0
- data/test/controllers/articles_controller_test.rb +7 -0
- data/test/controllers/comments_controller_test.rb +7 -0
- data/test/controllers/welcome_controller_test.rb +9 -0
- data/test/fixtures/.keep +0 -0
- data/test/fixtures/articles.yml +9 -0
- data/test/fixtures/comments.yml +11 -0
- data/test/helpers/.keep +0 -0
- data/test/helpers/articles_helper_test.rb +4 -0
- data/test/helpers/comments_helper_test.rb +4 -0
- data/test/helpers/welcome_helper_test.rb +4 -0
- data/test/integration/.keep +0 -0
- data/test/mailers/.keep +0 -0
- data/test/models/.keep +0 -0
- data/test/models/article_test.rb +7 -0
- data/test/models/comment_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- data/vendor/assets/javascripts/.keep +0 -0
- data/vendor/assets/stylesheets/.keep +0 -0
- metadata +186 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 24c5309597e0eff47fa5acb6707542d8ef37c04d
|
4
|
+
data.tar.gz: 610aa8f2fe7b223f7a41940752abe936379037a1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6bc83d1d91a5ab75748585aa07572ef9b5cb0388b6466c581e78bfb69ad7b3e0331343fb0cba3f7e86d370c78d694a78034eaa5cae7ddedb399fda0de4c87f27
|
7
|
+
data.tar.gz: ed93a2696a1824fe268d9cd3d2ba5786ebc12029c6630a3228cef8c1e5205e2b827661b52ce1f741fede913862aab881fc16590a76ae4e403549fb2db121f80f
|
data/.gitignore
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
data/Gemfile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
4
|
+
gem 'rails', '4.0.0'
|
5
|
+
|
6
|
+
# Use sqlite3 as the database for Active Record
|
7
|
+
gem 'sqlite3'
|
8
|
+
|
9
|
+
# Use SCSS for stylesheets
|
10
|
+
gem 'sass-rails', '~> 4.0.0'
|
11
|
+
|
12
|
+
# Use Uglifier as compressor for JavaScript assets
|
13
|
+
gem 'uglifier', '>= 1.3.0'
|
14
|
+
|
15
|
+
# Use CoffeeScript for .js.coffee assets and views
|
16
|
+
gem 'coffee-rails', '~> 4.0.0'
|
17
|
+
|
18
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
19
|
+
# gem 'therubyracer', platforms: :ruby
|
20
|
+
|
21
|
+
# Use jquery as the JavaScript library
|
22
|
+
gem 'jquery-rails'
|
23
|
+
|
24
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
25
|
+
gem 'turbolinks'
|
26
|
+
|
27
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
28
|
+
gem 'jbuilder', '~> 1.2'
|
29
|
+
|
30
|
+
group :doc do
|
31
|
+
# bundle exec rake doc:rails generates the API under doc/api.
|
32
|
+
gem 'sdoc', require: false
|
33
|
+
end
|
34
|
+
|
35
|
+
# Use ActiveModel has_secure_password
|
36
|
+
# gem 'bcrypt-ruby', '~> 3.0.0'
|
37
|
+
|
38
|
+
# Use unicorn as the app server
|
39
|
+
# gem 'unicorn'
|
40
|
+
|
41
|
+
# Use Capistrano for deployment
|
42
|
+
# gem 'capistrano', group: :development
|
43
|
+
|
44
|
+
# Use debugger
|
45
|
+
# gem 'debugger', group: [:development, :test]
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (4.0.0)
|
5
|
+
actionpack (= 4.0.0)
|
6
|
+
mail (~> 2.5.3)
|
7
|
+
actionpack (4.0.0)
|
8
|
+
activesupport (= 4.0.0)
|
9
|
+
builder (~> 3.1.0)
|
10
|
+
erubis (~> 2.7.0)
|
11
|
+
rack (~> 1.5.2)
|
12
|
+
rack-test (~> 0.6.2)
|
13
|
+
activemodel (4.0.0)
|
14
|
+
activesupport (= 4.0.0)
|
15
|
+
builder (~> 3.1.0)
|
16
|
+
activerecord (4.0.0)
|
17
|
+
activemodel (= 4.0.0)
|
18
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
19
|
+
activesupport (= 4.0.0)
|
20
|
+
arel (~> 4.0.0)
|
21
|
+
activerecord-deprecated_finders (1.0.3)
|
22
|
+
activesupport (4.0.0)
|
23
|
+
i18n (~> 0.6, >= 0.6.4)
|
24
|
+
minitest (~> 4.2)
|
25
|
+
multi_json (~> 1.3)
|
26
|
+
thread_safe (~> 0.1)
|
27
|
+
tzinfo (~> 0.3.37)
|
28
|
+
arel (4.0.2)
|
29
|
+
builder (3.1.4)
|
30
|
+
coffee-rails (4.0.1)
|
31
|
+
coffee-script (>= 2.2.0)
|
32
|
+
railties (>= 4.0.0, < 5.0)
|
33
|
+
coffee-script (2.2.0)
|
34
|
+
coffee-script-source
|
35
|
+
execjs
|
36
|
+
coffee-script-source (1.7.0)
|
37
|
+
erubis (2.7.0)
|
38
|
+
execjs (2.2.0)
|
39
|
+
hike (1.2.3)
|
40
|
+
i18n (0.6.9)
|
41
|
+
jbuilder (1.5.3)
|
42
|
+
activesupport (>= 3.0.0)
|
43
|
+
multi_json (>= 1.2.0)
|
44
|
+
jquery-rails (3.1.0)
|
45
|
+
railties (>= 3.0, < 5.0)
|
46
|
+
thor (>= 0.14, < 2.0)
|
47
|
+
json (1.8.1)
|
48
|
+
mail (2.5.4)
|
49
|
+
mime-types (~> 1.16)
|
50
|
+
treetop (~> 1.4.8)
|
51
|
+
mime-types (1.25.1)
|
52
|
+
minitest (4.7.5)
|
53
|
+
multi_json (1.10.1)
|
54
|
+
polyglot (0.3.5)
|
55
|
+
rack (1.5.2)
|
56
|
+
rack-test (0.6.2)
|
57
|
+
rack (>= 1.0)
|
58
|
+
rails (4.0.0)
|
59
|
+
actionmailer (= 4.0.0)
|
60
|
+
actionpack (= 4.0.0)
|
61
|
+
activerecord (= 4.0.0)
|
62
|
+
activesupport (= 4.0.0)
|
63
|
+
bundler (>= 1.3.0, < 2.0)
|
64
|
+
railties (= 4.0.0)
|
65
|
+
sprockets-rails (~> 2.0.0)
|
66
|
+
railties (4.0.0)
|
67
|
+
actionpack (= 4.0.0)
|
68
|
+
activesupport (= 4.0.0)
|
69
|
+
rake (>= 0.8.7)
|
70
|
+
thor (>= 0.18.1, < 2.0)
|
71
|
+
rake (10.3.2)
|
72
|
+
rdoc (4.1.1)
|
73
|
+
json (~> 1.4)
|
74
|
+
sass (3.2.19)
|
75
|
+
sass-rails (4.0.3)
|
76
|
+
railties (>= 4.0.0, < 5.0)
|
77
|
+
sass (~> 3.2.0)
|
78
|
+
sprockets (~> 2.8, <= 2.11.0)
|
79
|
+
sprockets-rails (~> 2.0)
|
80
|
+
sdoc (0.4.0)
|
81
|
+
json (~> 1.8)
|
82
|
+
rdoc (~> 4.0, < 5.0)
|
83
|
+
sprockets (2.11.0)
|
84
|
+
hike (~> 1.2)
|
85
|
+
multi_json (~> 1.0)
|
86
|
+
rack (~> 1.0)
|
87
|
+
tilt (~> 1.1, != 1.3.0)
|
88
|
+
sprockets-rails (2.0.1)
|
89
|
+
actionpack (>= 3.0)
|
90
|
+
activesupport (>= 3.0)
|
91
|
+
sprockets (~> 2.8)
|
92
|
+
sqlite3 (1.3.9-x86-mingw32)
|
93
|
+
thor (0.19.1)
|
94
|
+
thread_safe (0.3.4)
|
95
|
+
tilt (1.4.1)
|
96
|
+
treetop (1.4.15)
|
97
|
+
polyglot
|
98
|
+
polyglot (>= 0.3.1)
|
99
|
+
turbolinks (2.2.2)
|
100
|
+
coffee-rails
|
101
|
+
tzinfo (0.3.39)
|
102
|
+
uglifier (2.5.1)
|
103
|
+
execjs (>= 0.3.0)
|
104
|
+
json (>= 1.8.0)
|
105
|
+
|
106
|
+
PLATFORMS
|
107
|
+
x86-mingw32
|
108
|
+
|
109
|
+
DEPENDENCIES
|
110
|
+
coffee-rails (~> 4.0.0)
|
111
|
+
jbuilder (~> 1.2)
|
112
|
+
jquery-rails
|
113
|
+
rails (= 4.0.0)
|
114
|
+
sass-rails (~> 4.0.0)
|
115
|
+
sdoc
|
116
|
+
sqlite3
|
117
|
+
turbolinks
|
118
|
+
uglifier (>= 1.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Weldon
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Archerplume
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'archerplume'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install archerplume
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/README.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
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>.
|
data/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,16 @@
|
|
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
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require turbolinks
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,18 @@
|
|
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
|
+
*/
|
14
|
+
|
15
|
+
* {
|
16
|
+
font-family: Segoe UI;
|
17
|
+
|
18
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
class ArticlesController < ApplicationController
|
2
|
+
|
3
|
+
http_basic_authenticate_with name: "guest", password: "secret", except:
|
4
|
+
[:index, :show]
|
5
|
+
|
6
|
+
def new
|
7
|
+
@article = Article.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
@article = Article.new(article_params)
|
12
|
+
@article.save
|
13
|
+
redirect_to @article
|
14
|
+
end
|
15
|
+
|
16
|
+
def show
|
17
|
+
@article = Article.find(params[:id])
|
18
|
+
end
|
19
|
+
|
20
|
+
def edit
|
21
|
+
@article = Article.find(params[:id])
|
22
|
+
end
|
23
|
+
|
24
|
+
def update
|
25
|
+
@article = Article.find(params[:id])
|
26
|
+
if @article.update(article_params)
|
27
|
+
redirect_to @article
|
28
|
+
else
|
29
|
+
render 'edit'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def index
|
34
|
+
@articles = Article.all
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy
|
38
|
+
@article = Article.find(params[:id])
|
39
|
+
@article.destroy
|
40
|
+
redirect_to articles_path
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
def article_params
|
45
|
+
params.require(:article).permit(:title, :text)
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CommentsController < ApplicationController
|
2
|
+
http_basic_authenticate_with name: "admin", password: "53cr3t", only: :destroy
|
3
|
+
|
4
|
+
def create
|
5
|
+
@article = Article.find(params[:article_id])
|
6
|
+
@comment = @article.comments.create(comment_params)
|
7
|
+
redirect_to article_path(@article)
|
8
|
+
end
|
9
|
+
|
10
|
+
def destroy
|
11
|
+
@article = Article.find(params[:article_id])
|
12
|
+
@comment = @article.comments.find(params[:id])
|
13
|
+
@comment.destroy
|
14
|
+
redirect_to article_path(@article)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def comment_params
|
19
|
+
params.require(:comment).permit(:commenter, :body)
|
20
|
+
end
|
21
|
+
end
|
File without changes
|
data/app/mailers/.keep
ADDED
File without changes
|
data/app/models/.keep
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= form_for @article do |f| %>
|
2
|
+
<% if @article.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@article.errors.count, "error") %> prohibited
|
5
|
+
this article from being saved:</h2>
|
6
|
+
<ul>
|
7
|
+
<% @article.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<p>
|
14
|
+
<%= f.label :title %><br>
|
15
|
+
<%= f.text_field :title %>
|
16
|
+
</p>
|
17
|
+
<p>
|
18
|
+
<%= f.label :text %><br>
|
19
|
+
<%= f.text_area :text %>
|
20
|
+
</p>
|
21
|
+
<p>
|
22
|
+
<%= f.submit %>
|
23
|
+
</p>
|
24
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<table>
|
2
|
+
<tr>
|
3
|
+
<th>Title</th>
|
4
|
+
<th>Text</th>
|
5
|
+
<th colspan="2"></th>
|
6
|
+
</tr>
|
7
|
+
<% @articles.each do |article| %>
|
8
|
+
<tr>
|
9
|
+
<td><%= article.title %></td>
|
10
|
+
<td><%= article.text %></td>
|
11
|
+
<%= link_to 'New article', new_article_path %>
|
12
|
+
<td><%= link_to 'Show', article_path(article) %></td>
|
13
|
+
<td><%= link_to 'Edit', edit_article_path(article) %></td>
|
14
|
+
<td><%= link_to 'Destroy', article_path(article),
|
15
|
+
method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</table>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h1>New Article</h1>
|
2
|
+
|
3
|
+
<%= form_for :article, url: articles_path do |f| %>
|
4
|
+
<% if @article.errors.any? %>
|
5
|
+
<div id="error_explanation">
|
6
|
+
<h2><%= pluralize(@article.errors.count, "error") %> prohibited
|
7
|
+
this article from being saved:</h2>
|
8
|
+
<ul>
|
9
|
+
<% @article.errors.full_messages.each do |msg| %>
|
10
|
+
<li><%= msg %></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
<p>
|
16
|
+
<%= f.label :title %><br>
|
17
|
+
<%= f.text_field :title %>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<%= f.label :text %><br>
|
21
|
+
<%= f.text_area :text %>
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
<%= f.submit %>
|
25
|
+
</p>
|
26
|
+
<% end %>
|
27
|
+
<%= link_to 'Back', articles_path %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
<strong>Title:</strong>
|
3
|
+
<%= @article.title %>
|
4
|
+
</p>
|
5
|
+
<p>
|
6
|
+
<strong>Text:</strong>
|
7
|
+
<%= @article.text %>
|
8
|
+
</p>
|
9
|
+
<h2>Comments</h2>
|
10
|
+
<%= render @article.comments %>
|
11
|
+
<h2>Add a comment:</h2>
|
12
|
+
<%= form_for([@article, @article.comments.build]) do |f| %>
|
13
|
+
<p>
|
14
|
+
<%= f.label :commenter %><br>
|
15
|
+
<%= f.text_field :commenter %>
|
16
|
+
</p>
|
17
|
+
<p>
|
18
|
+
<%= f.label :body %><br>
|
19
|
+
<%= f.text_area :body %>
|
20
|
+
</p>
|
21
|
+
<p>
|
22
|
+
<%= f.submit %>
|
23
|
+
</p>
|
24
|
+
<% end %>
|
25
|
+
<%= link_to 'Edit Article', edit_article_path(@article) %> |
|
26
|
+
<%= link_to 'Back to Articles', articles_path %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<p>
|
2
|
+
<strong>Commenter:</strong>
|
3
|
+
<%= comment.commenter %>
|
4
|
+
</p>
|
5
|
+
<p>
|
6
|
+
<strong>Comment:</strong>
|
7
|
+
<%= comment.body %>
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
<%= link_to 'Destroy Comment', [comment.article, comment],
|
11
|
+
method: :delete,
|
12
|
+
data: { confirm: 'Are you sure?' } %>
|
13
|
+
</p>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= form_for([@article, @article.comments.build]) do |f| %>
|
2
|
+
<p>
|
3
|
+
<%= f.label :commenter %><br>
|
4
|
+
<%= f.text_field :commenter %>
|
5
|
+
</p>
|
6
|
+
<p>
|
7
|
+
<%= f.label :body %><br>
|
8
|
+
<%= f.text_area :body %>
|
9
|
+
</p>
|
10
|
+
<p>
|
11
|
+
<%= f.submit %>
|
12
|
+
</p>
|
13
|
+
<% end %>
|
14
|
+
<p>
|
15
|
+
<strong>Title:</strong>
|
16
|
+
<%= @article.title %>
|
17
|
+
</p>
|
18
|
+
<p>
|
19
|
+
<strong>Text:</strong>
|
20
|
+
<%= @article.text %>
|
21
|
+
</p>
|
22
|
+
<h2>Comments</h2>
|
23
|
+
<%= render @article.comments %>
|
24
|
+
<h2>Add a comment:</h2>
|
25
|
+
<%= render "comments/form" %>
|
26
|
+
<%= link_to 'Edit Article', edit_article_path(@article) %> |
|
27
|
+
<%= link_to 'Back to Articles', articles_path %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Archerplume</title>
|
5
|
+
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
6
|
+
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>Hello, Rails!</h1>
|
data/archerplume.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'archerplume/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "archerplume"
|
8
|
+
spec.version = Archerplume::VERSION
|
9
|
+
spec.authors = ["Weldon"]
|
10
|
+
spec.email = ["weldon23.henson23@gmail.com\t"]
|
11
|
+
spec.description = "ArcherPlume Blog FrameWork"
|
12
|
+
spec.summary = "ABF"
|
13
|
+
spec.homepage = "http://archercraftstore.github.io"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|