wheels 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/controllers/blogs_controller.rb +6 -2
- data/app/models/blog.rb +2 -0
- data/app/views/blogs/show.html.haml +23 -7
- data/wheels.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.40
|
|
@@ -12,12 +12,16 @@ class BlogsController < InheritedResources::Base
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
def parent
|
|
16
|
+
@user ||= User.find(params[:user_id])
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
def tags
|
|
16
|
-
@tags ||= Blog.where(:user_id
|
|
20
|
+
@tags ||= Blog.where(:user_id=>parent.id).tag_counts.sort{|t, u| t.count <=> u.count}
|
|
17
21
|
end
|
|
18
22
|
|
|
19
23
|
def collection
|
|
20
|
-
@blogs ||= Blog.where(:user_id
|
|
24
|
+
@blogs ||= Blog.where(:user_id=>parent.id).
|
|
21
25
|
paginate(:page => params[:page], :order => 'created_at DESC' )
|
|
22
26
|
end
|
|
23
27
|
|
data/app/models/blog.rb
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
|
|
2
|
+
.entry
|
|
3
|
+
.entry-title= link_to resource.title, resource_url(resource)
|
|
4
|
+
|
|
5
|
+
.date Posted on #{resource.created_at}
|
|
6
|
+
.blog_body!= resource.body
|
|
7
|
+
.tags!= tag_list resource
|
|
8
|
+
|
|
9
|
+
.comments
|
|
10
|
+
%a{:href => "#"} 3 comments
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
= will_paginate collection
|
|
15
|
+
|
|
16
|
+
- content_for(:tags) do
|
|
17
|
+
- for tag in tags
|
|
18
|
+
%li= link_to tag.name, user_blogs_path(parent, :tag=>tag.name)
|
|
19
|
+
|
|
20
|
+
|
|
8
21
|
= link_to 'Back', collection_url
|
|
22
|
+
= link_to '| Edit', edit_resource_url if can? :edit, resource
|
|
23
|
+
- if current_user.try(:id) == parent.id
|
|
24
|
+
= link_to '| New Blog Post', new_user_blog_path(parent)
|
|
9
25
|
|
data/wheels.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wheels
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 79
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 40
|
|
10
|
+
version: 0.0.40
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Tyler Gannon
|