diff --git a/examples/blog/app/views/comments/edit.erb b/examples/blog/app/views/comments/edit.erb new file mode 100644 index 0000000..519b843 --- /dev/null +++ b/examples/blog/app/views/comments/edit.erb @@ -0,0 +1,22 @@ +

<%= t('comments.edit_heading') %>

+ +<% unless errors.empty? %> +

<%= t('posts.errors_heading') %>

+ +<% end %> + +<% form_for(comment, url: url_for(:comment, post_id: post.to_param, id: comment.id)) do |f| %> + <%== f.hidden_field(:lock_version) %> +

+ <%== f.label(:body, t('comments.body_label')) %> + <%== f.text_area(:body) %> + <%== f.error_messages(:body) %> +

+ <%== f.submit(t('comments.update_submit')) %> +<% end %> + +

<%== link_to(t('posts.back_to_list'), url_for(:post, slug: post.to_param)) %>

diff --git a/examples/blog/app/views/comments/index.erb b/examples/blog/app/views/comments/index.erb new file mode 100644 index 0000000..d125c72 --- /dev/null +++ b/examples/blog/app/views/comments/index.erb @@ -0,0 +1,16 @@ +

<%= t('comments.heading') %>

+

<%== link_to(post.title, url_for(:post, slug: post.to_param)) %>

+ +<% if comments.none? %> +

<%= t('comments.empty') %>

+<% else %> + +<% end %> + +<%== paginate(comments, path: ->(page) { "#{url_for(:comments, post_id: post.to_param)}?page=#{page}" }) %> + +

<%== link_to(t('posts.back_to_list'), url_for(:posts)) %>

diff --git a/examples/blog/app/views/comments/trash.erb b/examples/blog/app/views/comments/trash.erb new file mode 100644 index 0000000..4d8cf0a --- /dev/null +++ b/examples/blog/app/views/comments/trash.erb @@ -0,0 +1,27 @@ +<% if notice %> +

<%= notice %>

+<% end %> + +

<%= t('comments.trash_heading') %>

+ +<% if comments.empty? %> +

<%= t('comments.trash_empty') %>

+<% else %> + +<% end %> + +

<%== link_to(t('posts.back_to_list'), url_for(:posts)) %>