aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/app')
-rw-r--r--guides/code/getting_started/app/assets/javascripts/application.js15
-rw-r--r--guides/code/getting_started/app/assets/javascripts/articles.js.coffee3
-rw-r--r--guides/code/getting_started/app/assets/javascripts/comments.js.coffee3
-rw-r--r--guides/code/getting_started/app/assets/javascripts/welcome.js.coffee3
-rw-r--r--guides/code/getting_started/app/assets/stylesheets/application.css13
-rw-r--r--guides/code/getting_started/app/assets/stylesheets/articles.css.scss3
-rw-r--r--guides/code/getting_started/app/assets/stylesheets/comments.css.scss3
-rw-r--r--guides/code/getting_started/app/assets/stylesheets/welcome.css.scss3
-rw-r--r--guides/code/getting_started/app/controllers/application_controller.rb5
-rw-r--r--guides/code/getting_started/app/controllers/articles_controller.rb53
-rw-r--r--guides/code/getting_started/app/controllers/comments_controller.rb23
-rw-r--r--guides/code/getting_started/app/controllers/concerns/.keep0
-rw-r--r--guides/code/getting_started/app/controllers/welcome_controller.rb4
-rw-r--r--guides/code/getting_started/app/helpers/application_helper.rb2
-rw-r--r--guides/code/getting_started/app/helpers/articles_helper.rb2
-rw-r--r--guides/code/getting_started/app/helpers/comments_helper.rb2
-rw-r--r--guides/code/getting_started/app/helpers/welcome_helper.rb2
-rw-r--r--guides/code/getting_started/app/mailers/.keep0
-rw-r--r--guides/code/getting_started/app/models/.keep0
-rw-r--r--guides/code/getting_started/app/models/article.rb7
-rw-r--r--guides/code/getting_started/app/models/comment.rb3
-rw-r--r--guides/code/getting_started/app/models/concerns/.keep0
-rw-r--r--guides/code/getting_started/app/views/articles/_form.html.erb27
-rw-r--r--guides/code/getting_started/app/views/articles/edit.html.erb5
-rw-r--r--guides/code/getting_started/app/views/articles/index.html.erb21
-rw-r--r--guides/code/getting_started/app/views/articles/new.html.erb5
-rw-r--r--guides/code/getting_started/app/views/articles/show.html.erb18
-rw-r--r--guides/code/getting_started/app/views/comments/_comment.html.erb15
-rw-r--r--guides/code/getting_started/app/views/comments/_form.html.erb13
-rw-r--r--guides/code/getting_started/app/views/layouts/application.html.erb14
-rw-r--r--guides/code/getting_started/app/views/welcome/index.html.erb4
31 files changed, 0 insertions, 271 deletions
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
--- a/guides/code/getting_started/app/controllers/concerns/.keep
+++ /dev/null
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
--- a/guides/code/getting_started/app/mailers/.keep
+++ /dev/null
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
--- a/guides/code/getting_started/app/models/.keep
+++ /dev/null
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
--- a/guides/code/getting_started/app/models/concerns/.keep
+++ /dev/null
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? %>
- <div id="error_explanation">
- <h2><%= pluralize(@article.errors.count, "error") %> prohibited
- this article from being saved:</h2>
- <ul>
- <% @article.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
- <p>
- <%= f.label :title %><br>
- <%= f.text_field :title %>
- </p>
-
- <p>
- <%= f.label :text %><br>
- <%= f.text_area :text %>
- </p>
-
- <p>
- <%= f.submit %>
- </p>
-<% 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 @@
-<h1>Edit article</h1>
-
-<%= 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 @@
-<h1>Listing Articles</h1>
-<table>
- <tr>
- <th>Title</th>
- <th>Text</th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
-
-<% @articles.each do |article| %>
- <tr>
- <td><%= article.title %></td>
- <td><%= article.text %></td>
- <td><%= link_to 'Show', action: :show, id: article.id %></td>
- <td><%= link_to 'Edit', action: :edit, id: article.id %></td>
- <td><%= link_to 'Destroy', { action: :destroy, id: article.id },
- method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
-<% end %>
-</table>
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 @@
-<h1>New article</h1>
-
-<%= 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 @@
-<p>
- <strong>Title:</strong>
- <%= @article.title %>
-</p>
-
-<p>
- <strong>Text:</strong>
- <%= @article.text %>
-</p>
-
-<h2>Comments</h2>
-<%= render @article.comments %>
-
-<h2>Add a comment:</h2>
-<%= 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 @@
-<p>
- <strong>Commenter:</strong>
- <%= comment.commenter %>
-</p>
-
-<p>
- <strong>Comment:</strong>
- <%= comment.body %>
-</p>
-
-<p>
- <%= link_to 'Destroy Comment', [comment.article, comment],
- method: :delete,
- data: { confirm: 'Are you sure?' } %>
-</p>
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| %>
- <p>
- <%= f.label :commenter %><br />
- <%= f.text_field :commenter %>
- </p>
- <p>
- <%= f.label :body %><br />
- <%= f.text_area :body %>
- </p>
- <p>
- <%= f.submit %>
- </p>
-<% 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 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Blog</title>
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
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 @@
-<h1>Hello, Rails!</h1>
-
-<%= link_to "My Blog", controller: "articles" %>
-<%= link_to "New Article", new_article_path %>