From 45072f34d27bda34b182f14f8b02d778d1648cce Mon Sep 17 00:00:00 2001 From: John Kelly Ferguson Date: Sun, 25 May 2014 18:48:14 -0400 Subject: Rename Posts to Articles in Guides' Getting Started App, continuation of #15215 [ci skip] --- .../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 | 4 ++-- .../app/views/comments/_form.html.erb | 2 +- .../getting_started/app/views/posts/_form.html.erb | 27 ---------------------- .../getting_started/app/views/posts/edit.html.erb | 5 ---- .../getting_started/app/views/posts/index.html.erb | 21 ----------------- .../getting_started/app/views/posts/new.html.erb | 5 ---- .../getting_started/app/views/posts/show.html.erb | 18 --------------- .../app/views/welcome/index.html.erb | 4 ++-- 13 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 guides/code/getting_started/app/views/articles/_form.html.erb create mode 100644 guides/code/getting_started/app/views/articles/edit.html.erb create mode 100644 guides/code/getting_started/app/views/articles/index.html.erb create mode 100644 guides/code/getting_started/app/views/articles/new.html.erb create mode 100644 guides/code/getting_started/app/views/articles/show.html.erb delete mode 100644 guides/code/getting_started/app/views/posts/_form.html.erb delete mode 100644 guides/code/getting_started/app/views/posts/edit.html.erb delete mode 100644 guides/code/getting_started/app/views/posts/index.html.erb delete mode 100644 guides/code/getting_started/app/views/posts/new.html.erb delete mode 100644 guides/code/getting_started/app/views/posts/show.html.erb (limited to 'guides/code/getting_started/app/views') diff --git a/guides/code/getting_started/app/views/articles/_form.html.erb b/guides/code/getting_started/app/views/articles/_form.html.erb new file mode 100644 index 0000000000..87e3353ed2 --- /dev/null +++ b/guides/code/getting_started/app/views/articles/_form.html.erb @@ -0,0 +1,27 @@ +<%= 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 new file mode 100644 index 0000000000..14236e2a98 --- /dev/null +++ b/guides/code/getting_started/app/views/articles/edit.html.erb @@ -0,0 +1,5 @@ +

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 new file mode 100644 index 0000000000..80e9c8c60c --- /dev/null +++ b/guides/code/getting_started/app/views/articles/index.html.erb @@ -0,0 +1,21 @@ +

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 new file mode 100644 index 0000000000..652b1c9c0b --- /dev/null +++ b/guides/code/getting_started/app/views/articles/new.html.erb @@ -0,0 +1,5 @@ +

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 new file mode 100644 index 0000000000..6959c80bdb --- /dev/null +++ b/guides/code/getting_started/app/views/articles/show.html.erb @@ -0,0 +1,18 @@ +

+ 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 index 593493339e..f7cbfaebfa 100644 --- a/guides/code/getting_started/app/views/comments/_comment.html.erb +++ b/guides/code/getting_started/app/views/comments/_comment.html.erb @@ -2,14 +2,14 @@ Commenter: <%= comment.commenter %>

- +

Comment: <%= comment.body %>

- <%= link_to 'Destroy Comment', [comment.post, comment], + <%= 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 index 00cb3a08f0..5850c41a17 100644 --- a/guides/code/getting_started/app/views/comments/_form.html.erb +++ b/guides/code/getting_started/app/views/comments/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for([@post, @post.comments.build]) do |f| %> +<%= form_for([@article, @article.comments.build]) do |f| %>

<%= f.label :commenter %>
<%= f.text_field :commenter %> diff --git a/guides/code/getting_started/app/views/posts/_form.html.erb b/guides/code/getting_started/app/views/posts/_form.html.erb deleted file mode 100644 index f2f83585e1..0000000000 --- a/guides/code/getting_started/app/views/posts/_form.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= form_for @post do |f| %> - <% if @post.errors.any? %> -

-

<%= pluralize(@post.errors.count, "error") %> prohibited - this post 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/posts/edit.html.erb b/guides/code/getting_started/app/views/posts/edit.html.erb deleted file mode 100644 index 393e7430d0..0000000000 --- a/guides/code/getting_started/app/views/posts/edit.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Edit post

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

Listing Posts

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

New post

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

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

- -

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

- -

Comments

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

Add a comment:

-<%= render "comments/form" %> - -<%= link_to 'Edit Post', edit_post_path(@post) %> | -<%= link_to 'Back to Posts', posts_path %> diff --git a/guides/code/getting_started/app/views/welcome/index.html.erb b/guides/code/getting_started/app/views/welcome/index.html.erb index 56be8dd3cc..1cabd0d217 100644 --- a/guides/code/getting_started/app/views/welcome/index.html.erb +++ b/guides/code/getting_started/app/views/welcome/index.html.erb @@ -1,4 +1,4 @@

Hello, Rails!

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