spud_blog 0.1.1 → 0.1.2
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/app/controllers/blog_controller.rb +7 -2
- metadata +5 -5
@@ -1,7 +1,7 @@
|
|
1
1
|
class BlogController < ApplicationController
|
2
2
|
|
3
3
|
respond_to :html, :xml, :json
|
4
|
-
before_filter :find_post, :only => [:show
|
4
|
+
before_filter :find_post, :only => [:show]
|
5
5
|
layout Spud::Blog.base_layout
|
6
6
|
|
7
7
|
def index
|
@@ -45,10 +45,15 @@ class BlogController < ApplicationController
|
|
45
45
|
|
46
46
|
def create_comment
|
47
47
|
return unless params[:comment_validation].empty? # trap spam bots
|
48
|
+
@post = SpudPost.find(params[:id])
|
49
|
+
if @post.blank?
|
50
|
+
flash[:error] = "Post not found!"
|
51
|
+
redirect_to blog_path and return false
|
52
|
+
end
|
48
53
|
@comment = @post.comments.new(params[:spud_post_comment])
|
49
54
|
flash[:notice] = 'Your comment has been posted, however it will not appear until it is approved.' if @comment.save
|
50
55
|
respond_with @comment do |format|
|
51
|
-
format.html { redirect_to blog_post_path(@post, :anchor => 'spud_post_comment_form') }
|
56
|
+
format.html { redirect_to blog_post_path(@post.url_name, :anchor => 'spud_post_comment_form') }
|
52
57
|
end
|
53
58
|
end
|
54
59
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spud_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spud_core
|
16
|
-
requirement: &
|
16
|
+
requirement: &70264146677240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.4.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70264146677240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: will_paginate
|
27
|
-
requirement: &
|
27
|
+
requirement: &70264138310740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70264138310740
|
36
36
|
description:
|
37
37
|
email: greg@westlakedesign.com
|
38
38
|
executables: []
|