From 5223bad17c9bb103fa6f558e936cc1303ecee4bf Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sat, 14 Jun 2014 16:18:22 +0200 Subject: docs, remove getting started guide sample application. [ci skip] This application always gets out of sync and doesn't add much value. Closes #15721 /cc @rafaelfranca --- .../app/assets/javascripts/application.js | 15 ------ .../app/assets/javascripts/articles.js.coffee | 3 -- .../app/assets/javascripts/comments.js.coffee | 3 -- .../app/assets/javascripts/welcome.js.coffee | 3 -- .../app/assets/stylesheets/application.css | 13 ------ .../app/assets/stylesheets/articles.css.scss | 3 -- .../app/assets/stylesheets/comments.css.scss | 3 -- .../app/assets/stylesheets/welcome.css.scss | 3 -- .../app/controllers/application_controller.rb | 5 -- .../app/controllers/articles_controller.rb | 53 ---------------------- .../app/controllers/comments_controller.rb | 23 ---------- .../getting_started/app/controllers/concerns/.keep | 0 .../app/controllers/welcome_controller.rb | 4 -- .../app/helpers/application_helper.rb | 2 - .../getting_started/app/helpers/articles_helper.rb | 2 - .../getting_started/app/helpers/comments_helper.rb | 2 - .../getting_started/app/helpers/welcome_helper.rb | 2 - guides/code/getting_started/app/mailers/.keep | 0 guides/code/getting_started/app/models/.keep | 0 guides/code/getting_started/app/models/article.rb | 7 --- guides/code/getting_started/app/models/comment.rb | 3 -- .../code/getting_started/app/models/concerns/.keep | 0 .../app/views/articles/_form.html.erb | 27 ----------- .../app/views/articles/edit.html.erb | 5 -- .../app/views/articles/index.html.erb | 21 --------- .../app/views/articles/new.html.erb | 5 -- .../app/views/articles/show.html.erb | 18 -------- .../app/views/comments/_comment.html.erb | 15 ------ .../app/views/comments/_form.html.erb | 13 ------ .../app/views/layouts/application.html.erb | 14 ------ .../app/views/welcome/index.html.erb | 4 -- 31 files changed, 271 deletions(-) delete mode 100644 guides/code/getting_started/app/assets/javascripts/application.js delete mode 100644 guides/code/getting_started/app/assets/javascripts/articles.js.coffee delete mode 100644 guides/code/getting_started/app/assets/javascripts/comments.js.coffee delete mode 100644 guides/code/getting_started/app/assets/javascripts/welcome.js.coffee delete mode 100644 guides/code/getting_started/app/assets/stylesheets/application.css delete mode 100644 guides/code/getting_started/app/assets/stylesheets/articles.css.scss delete mode 100644 guides/code/getting_started/app/assets/stylesheets/comments.css.scss delete mode 100644 guides/code/getting_started/app/assets/stylesheets/welcome.css.scss delete mode 100644 guides/code/getting_started/app/controllers/application_controller.rb delete mode 100644 guides/code/getting_started/app/controllers/articles_controller.rb delete mode 100644 guides/code/getting_started/app/controllers/comments_controller.rb delete mode 100644 guides/code/getting_started/app/controllers/concerns/.keep delete mode 100644 guides/code/getting_started/app/controllers/welcome_controller.rb delete mode 100644 guides/code/getting_started/app/helpers/application_helper.rb delete mode 100644 guides/code/getting_started/app/helpers/articles_helper.rb delete mode 100644 guides/code/getting_started/app/helpers/comments_helper.rb delete mode 100644 guides/code/getting_started/app/helpers/welcome_helper.rb delete mode 100644 guides/code/getting_started/app/mailers/.keep delete mode 100644 guides/code/getting_started/app/models/.keep delete mode 100644 guides/code/getting_started/app/models/article.rb delete mode 100644 guides/code/getting_started/app/models/comment.rb delete mode 100644 guides/code/getting_started/app/models/concerns/.keep delete mode 100644 guides/code/getting_started/app/views/articles/_form.html.erb delete mode 100644 guides/code/getting_started/app/views/articles/edit.html.erb delete mode 100644 guides/code/getting_started/app/views/articles/index.html.erb delete mode 100644 guides/code/getting_started/app/views/articles/new.html.erb delete mode 100644 guides/code/getting_started/app/views/articles/show.html.erb delete mode 100644 guides/code/getting_started/app/views/comments/_comment.html.erb delete mode 100644 guides/code/getting_started/app/views/comments/_form.html.erb delete mode 100644 guides/code/getting_started/app/views/layouts/application.html.erb delete mode 100644 guides/code/getting_started/app/views/welcome/index.html.erb (limited to 'guides/code/getting_started/app') diff --git a/guides/code/getting_started/app/assets/javascripts/application.js b/guides/code/getting_started/app/assets/javascripts/application.js deleted file mode 100644 index 5a4fbaa370..0000000000 --- a/guides/code/getting_started/app/assets/javascripts/application.js +++ /dev/null @@ -1,15 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// stub path allows dependency to be excluded from the asset bundle. -// -//= require jquery -//= require jquery_ujs -//= require turbolinks -//= require_tree . diff --git a/guides/code/getting_started/app/assets/javascripts/articles.js.coffee b/guides/code/getting_started/app/assets/javascripts/articles.js.coffee deleted file mode 100644 index 24f83d18bb..0000000000 --- a/guides/code/getting_started/app/assets/javascripts/articles.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/guides/code/getting_started/app/assets/javascripts/comments.js.coffee b/guides/code/getting_started/app/assets/javascripts/comments.js.coffee deleted file mode 100644 index 24f83d18bb..0000000000 --- a/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee b/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee deleted file mode 100644 index 24f83d18bb..0000000000 --- a/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/guides/code/getting_started/app/assets/stylesheets/application.css b/guides/code/getting_started/app/assets/stylesheets/application.css deleted file mode 100644 index 3192ec897b..0000000000 --- a/guides/code/getting_started/app/assets/stylesheets/application.css +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - *= require_tree . - */ diff --git a/guides/code/getting_started/app/assets/stylesheets/articles.css.scss b/guides/code/getting_started/app/assets/stylesheets/articles.css.scss deleted file mode 100644 index cca548710d..0000000000 --- a/guides/code/getting_started/app/assets/stylesheets/articles.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the articles controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/guides/code/getting_started/app/assets/stylesheets/comments.css.scss b/guides/code/getting_started/app/assets/stylesheets/comments.css.scss deleted file mode 100644 index e730912783..0000000000 --- a/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Comments controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss b/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss deleted file mode 100644 index 77ce11a740..0000000000 --- a/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the welcome controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/guides/code/getting_started/app/controllers/application_controller.rb b/guides/code/getting_started/app/controllers/application_controller.rb deleted file mode 100644 index d83690e1b9..0000000000 --- a/guides/code/getting_started/app/controllers/application_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception -end diff --git a/guides/code/getting_started/app/controllers/articles_controller.rb b/guides/code/getting_started/app/controllers/articles_controller.rb deleted file mode 100644 index 275b84e8b7..0000000000 --- a/guides/code/getting_started/app/controllers/articles_controller.rb +++ /dev/null @@ -1,53 +0,0 @@ -class ArticlesController < ApplicationController - - http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show] - - def index - @articles = Article.all - end - - def show - @article = Article.find(params[:id]) - end - - def edit - @article = Article.find(params[:id]) - end - - def update - @article = Article.find(params[:id]) - - if @article.update(article_params) - redirect_to action: :show, id: @article.id - else - render 'edit' - end - end - - def new - @article = Article.new - end - - def create - @article = Article.new(article_params) - - if @article.save - redirect_to action: :show, id: @article.id - else - render 'new' - end - end - - def destroy - @article = Article.find(params[:id]) - @article.destroy - - redirect_to action: :index - end - - private - - def article_params - params.require(:article).permit(:title, :text) - end -end diff --git a/guides/code/getting_started/app/controllers/comments_controller.rb b/guides/code/getting_started/app/controllers/comments_controller.rb deleted file mode 100644 index 61813b1003..0000000000 --- a/guides/code/getting_started/app/controllers/comments_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CommentsController < ApplicationController - - http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy - - def create - @article = Article.find(params[:article_id]) - @comment = @article.comments.create(comment_params) - redirect_to article_path(@article) - end - - def destroy - @article = Article.find(params[:article_id]) - @comment = @article.comments.find(params[:id]) - @comment.destroy - redirect_to article_path(@article) - end - - private - - def comment_params - params.require(:comment).permit(:commenter, :body) - end -end diff --git a/guides/code/getting_started/app/controllers/concerns/.keep b/guides/code/getting_started/app/controllers/concerns/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/guides/code/getting_started/app/controllers/welcome_controller.rb b/guides/code/getting_started/app/controllers/welcome_controller.rb deleted file mode 100644 index f9b859b9c9..0000000000 --- a/guides/code/getting_started/app/controllers/welcome_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -class WelcomeController < ApplicationController - def index - end -end diff --git a/guides/code/getting_started/app/helpers/application_helper.rb b/guides/code/getting_started/app/helpers/application_helper.rb deleted file mode 100644 index de6be7945c..0000000000 --- a/guides/code/getting_started/app/helpers/application_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff --git a/guides/code/getting_started/app/helpers/articles_helper.rb b/guides/code/getting_started/app/helpers/articles_helper.rb deleted file mode 100644 index 2968277595..0000000000 --- a/guides/code/getting_started/app/helpers/articles_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ArticlesHelper -end diff --git a/guides/code/getting_started/app/helpers/comments_helper.rb b/guides/code/getting_started/app/helpers/comments_helper.rb deleted file mode 100644 index 0ec9ca5f2d..0000000000 --- a/guides/code/getting_started/app/helpers/comments_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module CommentsHelper -end diff --git a/guides/code/getting_started/app/helpers/welcome_helper.rb b/guides/code/getting_started/app/helpers/welcome_helper.rb deleted file mode 100644 index eeead45fc9..0000000000 --- a/guides/code/getting_started/app/helpers/welcome_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module WelcomeHelper -end diff --git a/guides/code/getting_started/app/mailers/.keep b/guides/code/getting_started/app/mailers/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/guides/code/getting_started/app/models/.keep b/guides/code/getting_started/app/models/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/guides/code/getting_started/app/models/article.rb b/guides/code/getting_started/app/models/article.rb deleted file mode 100644 index 6fc7888be2..0000000000 --- a/guides/code/getting_started/app/models/article.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Article < ActiveRecord::Base - has_many :comments, dependent: :destroy - - validates :title, - presence: true, - length: { minimum: 5 } -end diff --git a/guides/code/getting_started/app/models/comment.rb b/guides/code/getting_started/app/models/comment.rb deleted file mode 100644 index e2646a324f..0000000000 --- a/guides/code/getting_started/app/models/comment.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Comment < ActiveRecord::Base - belongs_to :article -end diff --git a/guides/code/getting_started/app/models/concerns/.keep b/guides/code/getting_started/app/models/concerns/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/guides/code/getting_started/app/views/articles/_form.html.erb b/guides/code/getting_started/app/views/articles/_form.html.erb deleted file mode 100644 index 87e3353ed2..0000000000 --- a/guides/code/getting_started/app/views/articles/_form.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= form_for @article do |f| %> - <% if @article.errors.any? %> -
-

<%= pluralize(@article.errors.count, "error") %> prohibited - this article from being saved:

- -
- <% end %> -

- <%= f.label :title %>
- <%= f.text_field :title %> -

- -

- <%= f.label :text %>
- <%= f.text_area :text %> -

- -

- <%= f.submit %> -

-<% end %> - diff --git a/guides/code/getting_started/app/views/articles/edit.html.erb b/guides/code/getting_started/app/views/articles/edit.html.erb deleted file mode 100644 index 14236e2a98..0000000000 --- a/guides/code/getting_started/app/views/articles/edit.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Edit article

- -<%= render 'form' %> - -<%= link_to 'Back', action: :index %> diff --git a/guides/code/getting_started/app/views/articles/index.html.erb b/guides/code/getting_started/app/views/articles/index.html.erb deleted file mode 100644 index 80e9c8c60c..0000000000 --- a/guides/code/getting_started/app/views/articles/index.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -

Listing Articles

- - - - - - - - - -<% @articles.each do |article| %> - - - - - - - -<% end %> -
TitleText
<%= article.title %><%= article.text %><%= link_to 'Show', action: :show, id: article.id %><%= link_to 'Edit', action: :edit, id: article.id %><%= link_to 'Destroy', { action: :destroy, id: article.id }, - method: :delete, data: { confirm: 'Are you sure?' } %>
diff --git a/guides/code/getting_started/app/views/articles/new.html.erb b/guides/code/getting_started/app/views/articles/new.html.erb deleted file mode 100644 index 652b1c9c0b..0000000000 --- a/guides/code/getting_started/app/views/articles/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

New article

- -<%= render 'form' %> - -<%= link_to 'Back', action: :index %> diff --git a/guides/code/getting_started/app/views/articles/show.html.erb b/guides/code/getting_started/app/views/articles/show.html.erb deleted file mode 100644 index 6959c80bdb..0000000000 --- a/guides/code/getting_started/app/views/articles/show.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -

- Title: - <%= @article.title %> -

- -

- Text: - <%= @article.text %> -

- -

Comments

-<%= render @article.comments %> - -

Add a comment:

-<%= render "comments/form" %> - -<%= link_to 'Edit Article', edit_article_path(@article) %> | -<%= link_to 'Back to Articles', articles_path %> diff --git a/guides/code/getting_started/app/views/comments/_comment.html.erb b/guides/code/getting_started/app/views/comments/_comment.html.erb deleted file mode 100644 index f7cbfaebfa..0000000000 --- a/guides/code/getting_started/app/views/comments/_comment.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -

- Commenter: - <%= comment.commenter %> -

- -

- Comment: - <%= comment.body %> -

- -

- <%= link_to 'Destroy Comment', [comment.article, comment], - method: :delete, - data: { confirm: 'Are you sure?' } %> -

diff --git a/guides/code/getting_started/app/views/comments/_form.html.erb b/guides/code/getting_started/app/views/comments/_form.html.erb deleted file mode 100644 index 5850c41a17..0000000000 --- a/guides/code/getting_started/app/views/comments/_form.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= form_for([@article, @article.comments.build]) do |f| %> -

- <%= f.label :commenter %>
- <%= f.text_field :commenter %> -

-

- <%= f.label :body %>
- <%= f.text_area :body %> -

-

- <%= f.submit %> -

-<% end %> diff --git a/guides/code/getting_started/app/views/layouts/application.html.erb b/guides/code/getting_started/app/views/layouts/application.html.erb deleted file mode 100644 index d0ba8415e6..0000000000 --- a/guides/code/getting_started/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Blog - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/guides/code/getting_started/app/views/welcome/index.html.erb b/guides/code/getting_started/app/views/welcome/index.html.erb deleted file mode 100644 index 1cabd0d217..0000000000 --- a/guides/code/getting_started/app/views/welcome/index.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -

Hello, Rails!

- -<%= link_to "My Blog", controller: "articles" %> -<%= link_to "New Article", new_article_path %> -- cgit v1.2.3