Skip to content

Commit 6e75c13

Browse files
committed
creating article
1 parent 49c6e59 commit 6e75c13

26 files changed

+204
-89
lines changed

Gemfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ gem 'jbuilder', '~> 2.0'
2323
# bundle exec rake doc:rails generates the API under doc/api.
2424
gem 'sdoc', '~> 0.4.0', group: :doc
2525

26-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27-
gem 'spring', group: :development
26+
group :development, :test do
27+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
28+
gem 'byebug'
29+
# Access an IRB console on exception pages or by using <%= console %> in views
30+
gem 'web-console', '~> 2.0'
31+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
32+
gem 'spring'
33+
# etter Errors replaces the standard Rails error page with a much better and more useful error page.
34+
gem 'better_errors'
35+
# Recommended for use only in debugging situations.
36+
gem 'binding_of_caller'
37+
end
38+
2839

2940
# Use ActiveModel has_secure_password
3041
# gem 'bcrypt', '~> 3.1.7'

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,25 @@ GEM
2828
thread_safe (~> 0.1)
2929
tzinfo (~> 1.1)
3030
arel (5.0.1.20140414130214)
31+
better_errors (2.1.1)
32+
coderay (>= 1.0.0)
33+
erubis (>= 2.6.6)
34+
rack (>= 0.9.0)
35+
binding_of_caller (0.7.2)
36+
debug_inspector (>= 0.0.1)
3137
builder (3.2.2)
38+
byebug (4.0.5)
39+
columnize (= 0.9.0)
40+
coderay (1.1.0)
3241
coffee-rails (4.0.1)
3342
coffee-script (>= 2.2.0)
3443
railties (>= 4.0.0, < 5.0)
3544
coffee-script (2.4.1)
3645
coffee-script-source
3746
execjs
3847
coffee-script-source (1.9.1.1)
48+
columnize (0.9.0)
49+
debug_inspector (0.0.2)
3950
erubis (2.7.0)
4051
execjs (2.5.2)
4152
hike (1.2.3)
@@ -103,11 +114,19 @@ GEM
103114
uglifier (2.7.1)
104115
execjs (>= 0.3.0)
105116
json (>= 1.8.0)
117+
web-console (2.1.2)
118+
activemodel (>= 4.0)
119+
binding_of_caller (>= 0.7.2)
120+
railties (>= 4.0)
121+
sprockets-rails (>= 2.0, < 4.0)
106122

107123
PLATFORMS
108124
ruby
109125

110126
DEPENDENCIES
127+
better_errors
128+
binding_of_caller
129+
byebug
111130
coffee-rails (~> 4.0.0)
112131
jbuilder (~> 2.0)
113132
jquery-rails
@@ -118,3 +137,4 @@ DEPENDENCIES
118137
sqlite3
119138
turbolinks
120139
uglifier (>= 1.3.0)
140+
web-console (~> 2.0)

README.rdoc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
== README
22

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>.
29-
30-
313
Features
324

335
1. blog post (show, read, create, edit, delete)
@@ -47,8 +19,3 @@ User Stories
4719
5. As a user, I can edit or delete my own comment.
4820
6. As a user, I can search for a specific post.
4921
7. As a user, I see "x" posts per page.
50-
51-
52-
53-
54-
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the articles controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the welcome controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class ArticlesController < ApplicationController
2+
3+
# def index
4+
#end
5+
6+
def show
7+
@article = Article.find(params[:id])
8+
9+
end
10+
11+
12+
def new
13+
14+
end
15+
16+
# def edit
17+
# end
18+
19+
def create
20+
@article = Article.new(article_params)
21+
22+
@article.save
23+
redirect_to @article
24+
end
25+
26+
#def update
27+
#end
28+
29+
#def destroy
30+
#end
31+
32+
33+
private
34+
35+
def article_params
36+
params.require(:article).permit(:title, :text)
37+
end
38+
39+
40+
41+
end

app/controllers/welcome_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class WelcomeController < ApplicationController
2+
def index
3+
end
4+
end

app/helpers/articles_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ArticlesHelper
2+
end

0 commit comments

Comments
 (0)