forked from vasil/ruby.mk
/
post.haml
46 lines (45 loc) · 1.23 KB
/
post.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
%h2
%a{ :href => post_path(@post) }
= @post.title
= @post.content
#comments
%ul
- for comment in @post.comments
%li
%p
= escape_html comment.content
%address
\—
= escape_html comment.author
- unless @comment.errors.empty?
%h4
Errors:
%ul
- @comment.errors.full_messages.each do |message|
%li
= message
%form{ :method => "post", :action => "#{post_path(@post)}/comments" }
%div
%label{ :for => "comment_author" }
Name
%br
%input#comment_author{ :name => "comment[author]", :type => "text", :value => @comment.author }
%div
%label{ :for => "comment_email" }
Email
%br
%input#comment_email{ :name => "comment[email]", :type => "text", :value => @comment.email }
%div
%label{ :for => "comment_url" }
URL
%br
%input#comment_url{ :name => "comment[url]", :type => "text", :value => @comment.url }
%div
%label{ :for => "comment_content" }
Your Comment
%br
%textarea#comment_content{ :name => "comment[content]", :rows => "6", :cols => "40" }
= @comment.content
%div
%button{ :type => "submit" }
Leave Comment