wheels 0.0.35 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.35
1
+ 0.0.36
@@ -1,8 +1,10 @@
1
1
  class BlogsController < InheritedResources::Base
2
- respond_to :html, :xml
3
2
  before_filter :load_maybe
4
- has_scope :tagged_with, :as => :tag
5
3
  belongs_to :user, :optional => true
4
+ has_scope :tagged_with, :as => :tag
5
+ helper_method :tags
6
+ respond_to :html, :xml
7
+
6
8
 
7
9
  def load_maybe
8
10
  unless params[:user_id]
@@ -10,15 +12,13 @@ class BlogsController < InheritedResources::Base
10
12
  end
11
13
  end
12
14
 
15
+ def tags
16
+ @tags ||= Blog.where(:user_id=>@user.id).tag_counts.sort{|t, u| t.count <=> u.count}
17
+ end
18
+
13
19
  def collection
14
20
  @blogs ||= Blog.where(:user_id=>@user.id).
15
21
  paginate(:page => params[:page], :order => 'created_at DESC' )
16
22
  end
17
-
18
- protected
19
- def begin_of_association_chain
20
- @tags = Blog.where(:user_id=>@user.id).tag_counts.sort{|t, u| t.count <=> u.count}
21
- return @user
22
- end
23
23
  end
24
24
 
@@ -9,14 +9,14 @@
9
9
  %li= msg
10
10
 
11
11
  .field
12
- = f.label :title
12
+ .fieldTitle Title
13
13
  = f.text_field :title
14
14
  .field
15
- = f.label "tag_list"
16
- .tag_list= f.text_area :tag_list
17
- .field
18
- = f.label :body
15
+ .fieldTitle Body
19
16
  = f.text_area :body, :class=>'ckeditor_textarea'
17
+ .field
18
+ .fieldTitle Tags:
19
+ .tag_list= f.text_field :tag_list
20
20
  .actions
21
21
  = f.submit 'Save'
22
22
 
@@ -1,8 +1,6 @@
1
- %h1 Someone's Blog
1
+ %h1= @user.profile.blog_title
2
2
 
3
3
  - @blogs.each do |blog|
4
- #ad-top
5
- / Insert 468x60 banner advertisement
6
4
  .entry
7
5
  .entry-title= link_to blog.title, resource_url(blog)
8
6
 
@@ -18,6 +16,6 @@
18
16
  = will_paginate @blogs
19
17
 
20
18
  - content_for(:tags) do
21
- - for tag in @tags
19
+ - for tag in tags
22
20
  %li= link_to tag.name, user_blogs_path(@user, :tag=>tag.name)
23
21
 
@@ -8,6 +8,7 @@ gem 'inherited_resources', '1.1.2'
8
8
  gem 'paperclip'
9
9
  gem 'rails3-generators'
10
10
  gem 'RedCloth'
11
+ gem 'will_paginate', "~> 3.0.pre2"
11
12
 
12
13
  route "root :to => \"blogs#index\""
13
14
 
data/wheels.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wheels}
8
- s.version = "0.0.35"
8
+ s.version = "0.0.36"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tyler Gannon"]
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: 89
4
+ hash: 87
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 35
10
- version: 0.0.35
9
+ - 36
10
+ version: 0.0.36
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tyler Gannon