diff --git a/Gemfile b/Gemfile index bda7f8f..f0d9c5d 100644 --- a/Gemfile +++ b/Gemfile @@ -44,5 +44,5 @@ gem 'rake' # Code coverage by CodeClimate gem "codeclimate-test-reporter", group: :test, require: nil -# Pdf -gem 'prawn', '~> 1.3.0' \ No newline at end of file +# Pdf https://github.com/prawnpdf/prawn +gem 'prawn', '~> 1.3.0' diff --git a/README.rdoc b/README.rdoc index f64de18..a7106ba 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,5 +1,7 @@ == README +===Process Project (MSOE) + Build Status (Travis CI) {Build Status}[https://travis-ci.org/lopezn/ProcessProject] @@ -10,3 +12,7 @@ Test Coverage (Code Climate) {}[https://codeclimate.com/github/lopezn/ProcessProject] This projects adds functionality to the project created by RailsGuides[http://guides.rubyonrails.org/getting_started.html] + +This project was created for a class at msoe where we learned process tools and practices. + +Pdf generation from the prawn gem https://github.com/prawnpdf/prawn diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 764c598..13bfd36 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -3,6 +3,7 @@ class ArticlesController < ApplicationController def new + # The new article to be created @article = Article.new end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 5586426..f0957ee 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,7 +1,12 @@ class CommentsController < ApplicationController def create + # The article to add a comment to @article = Article.find(params[:article_id]) + + # The comment to create @comment = @article.comments.create(comment_params) + + # Redirect back to article:show redirect_to article_path(@article) end diff --git a/app/models/article.rb b/app/models/article.rb index 2ffc62d..fa8555c 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -1,4 +1,4 @@ class Article < ActiveRecord::Base has_many :comments, dependent: :destroy - validates :title, presence: true, length: { minimum: 5 } + validates :title, presence: true, length: { minimum: 5 } # Title must be at least 5 characters long end