public
Description: Starter Kit for developers using Ruby on Rails to quickly get a blog up & running and then add features.
Homepage: http://www.faithfulgeek.org
Clone URL: git://github.com/faithfulgeek/blog-starter-kit.git
Search Repo:
Implemented textile using RedCloth gem; added styles for headings & 
blockquotes
Joe Fiorini (author)
Sun Apr 20 21:20:47 -0700 2008
commit  3ee7a2b008ecbd9a634c01d84bc9d38814f29fd9
tree    ba295e7010103e38eb5182041925b3469c3fc60c
parent  3be627078ced4ff1017e33fab2db2266f0b5c7ed
...
20
21
22
23
 
24
25
26
...
20
21
22
 
23
24
25
26
0
@@ -20,7 +20,7 @@
0
       end
0
     end
0
   end
0
-
0
+
0
   show.wants.xml { render :xml => @post }
0
   new_action.wants.xml { render :xml => @post }
0
   index.wants.xml { render :xml => @posts }
...
1
2
3
4
 
 
 
 
5
...
1
 
 
 
2
3
4
5
6
0
@@ -1,6 +1,7 @@
0
 module PostsHelper
0
- def previous_month(month)
0
- month.previous_month
0
- end
0
+ def textilize(value)
0
+ value = value.body if value.respond_to?(:body)
0
+ RedCloth.new(h(value)).to_html
0
+ end
0
 end
...
1
2
3
4
5
6
7
 
8
...
1
2
 
 
 
 
 
3
4
0
@@ -1,9 +1,5 @@
0
 class Post < ActiveRecord::Base
0
   acts_as_commentable :order => 'created_at desc'
0
-
0
- def body=(value)
0
- self[:body] = value.gsub("\n", "<br>")
0
- end
0
-
0
+
0
 end
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@
0
           = "Logged in as: " + @current_user.name
0
           = link_to 'Logout', logout_url
0
       %img{ :src => "/images/glasses.png" }/
0
- %h1
0
+ %h1#page-title
0
         %a{ :href => "/" }
0
           faithfulgeek.org
0
     #main
...
1
2
3
 
4
5
6
...
10
11
12
13
 
14
15
16
...
1
2
 
3
4
5
6
...
10
11
12
 
13
14
15
16
0
@@ -1,6 +1,6 @@
0
 .post
0
   %img{:src => "/images/icons/24-book-blue-mark.png"}
0
- %h2.title= link_to post.title, post
0
+ %h2#title= link_to post.title, post
0
   %h3#tags
0
     on
0
     = format_date_long(post.created_at)
0
@@ -10,7 +10,7 @@
0
     &ndash;
0
     %a{:href => "/tags/dogs"} dogs
0
   .post-content
0
- = post.body
0
+ = textilize post
0
     #tools
0
       = link_to "#{post.comments.length} comments", comments_for_post_path(post.id)
0
       &ndash;
...
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
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,33 +1 @@
0
-<h1>Editing post</h1>
0
-
0
-<%= error_messages_for :post %>
0
-
0
-<% form_for(@post) do |f| %>
0
- <p>
0
- <b>Title</b><br />
0
- <%= f.text_field :title %>
0
- </p>
0
-
0
- <p>
0
- <b>Body</b><br />
0
- <%= f.text_area :body %>
0
- </p>
0
-
0
- <p>
0
- <b>Excerpt</b><br />
0
- <%= f.text_area :excerpt %>
0
- </p>
0
-
0
- <p>
0
- <b>Is published</b><br />
0
- <%= f.check_box :is_published %>
0
- </p>
0
-
0
- <p>
0
- <%= f.submit "Update" %>
0
- </p>
0
-<% end %>
0
-
0
-<%= link_to 'Show', @post %> |
0
-<%= link_to 'Back', posts_path %>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -1 +1,23 @@
0
+%h2
0
+ Editing Post
0
+ = @post.title
0
+
0
+= error_messages_for :post
0
+
0
+- form_for(@post) do |f|
0
+ %p
0
+ = title_label
0
+ = f.text_field :title
0
+ %p
0
+ = body_label
0
+ ~ f.text_area :body
0
+ %p
0
+ = is_published_label
0
+ = f.check_box :is_published
0
+ %p
0
+ = f.submit "Update"
0
+
0
+= link_to 'Show', @post
0
+|
0
+= link_to 'Back', posts_path
...
61
62
63
 
...
61
62
63
64
0
@@ -61,4 +61,5 @@
0
 end
0
 
0
 require 'lib/ActionView/base'
0
+require 'RedCloth'
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@
0
   map.home 'home', :controller => 'posts'
0
   map.login 'login', :controller => 'sessions', :action => 'new'
0
   map.logout 'logout', :controller => 'sessions', :action => 'destroy'
0
- map.comments_for_post 'posts//:id', :controller => 'posts', :action => 'show', :anchor => 'comments'
0
+ map.comments_for_post 'posts/show/:id', :controller => 'posts', :action => 'show', :anchor => 'comments'
0
   
0
   map.resources :posts, :has_many => :comments
0
     
...
1
2
3
 
4
5
6
7
...
18
19
20
21
22
23
24
25
26
27
28
...
1
2
 
3
4
5
6
7
...
18
19
20
 
21
22
23
 
24
25
26
0
@@ -1,6 +1,6 @@
0
 module ActionView
0
   class Base
0
-
0
+
0
     def method_missing(symbol, *args)
0
       if symbol.to_s. =~ /_label$/
0
         self.class.instance_eval do
0
0
@@ -18,11 +18,9 @@
0
 
0
            label(:post, symbol.to_s.gsub(/_label/, ''), label_text + prompt_char) + (is_required ? required_char : '')
0
           }
0
-
0
         end
0
 
0
         send symbol
0
-
0
       end
0
     end
0
   end
...
4
5
6
7
 
8
9
10
11
12
13
14
15
16
...
16
17
18
19
 
20
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
23
24
25
26
 
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
 
30
31
32
...
35
36
37
 
38
39
40
...
164
165
166
 
167
168
169
...
4
5
6
 
7
8
9
10
11
12
13
14
15
16
...
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
...
71
72
73
74
75
76
77
...
201
202
203
204
205
206
207
0
@@ -4,7 +4,7 @@
0
   background: #f1efdc url('/images/bg.jpg') repeat-x;
0
 }
0
 
0
-h1
0
+h1#page-title
0
 {
0
   color: white;
0
   font-size: 1.5em;
0
0
0
0
0
0
0
@@ -16,17 +16,53 @@
0
   border: none;
0
 }
0
 
0
-h2
0
+h1, h2, h3, h4, h5, h6
0
 {
0
- color: #99f;
0
+ color: #333;
0
+ font-family: "Times New Roman", "verdanya", Times, Serif;
0
+ font-weight: 300;
0
+ letter-spacing: 0.01em;
0
+ padding: 0.2em 0;
0
+ margin:0.5em 0;
0
+}
0
+
0
+h1
0
+{
0
+ font-size: 2.5em;
0
+}
0
+
0
+h2
0
+{
0
+
0
+ font-size:2em;
0
+}
0
+
0
+h3
0
+{
0
   font-size: 1.75em;
0
- display: inline;
0
 }
0
 
0
-h2.title
0
+h4
0
 {
0
+ font-size: 1.25em;
0
+}
0
+
0
+h5
0
+{
0
+ font-size: 1.15em;
0
+}
0
+
0
+h6
0
+{
0
+ font-size: 1.1em;
0
+}
0
+
0
+h2#title
0
+{
0
   font-family: georgia, 'times new roman', serif;
0
+ border: 0;
0
   font-size: 1.65em;
0
+ display: inline;
0
 }
0
 
0
 h3#tags
0
@@ -35,6 +71,7 @@
0
   color: #666;
0
   margin-top: 7px;
0
   margin-bottom: 7px;
0
+ border: 0;
0
 }
0
 
0
 a, a:link, a:visited, a:active
0
@@ -164,6 +201,7 @@
0
   border-top: 1px solid #bbb;
0
   padding-top: 7px;
0
   text-align: left;
0
+ line-height: 1.25em;
0
 }
0
 
0
 .comment

Comments

    No one has commented yet.