aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/refinery/admin/blog/posts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/refinery/admin/blog/posts_controller.rb')
-rw-r--r--app/controllers/refinery/admin/blog/posts_controller.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/refinery/admin/blog/posts_controller.rb b/app/controllers/refinery/admin/blog/posts_controller.rb
index 8b3816d..4645f3f 100644
--- a/app/controllers/refinery/admin/blog/posts_controller.rb
+++ b/app/controllers/refinery/admin/blog/posts_controller.rb
@@ -34,6 +34,10 @@ module Refinery
render :json => @tags.flatten
end
+ def new
+ @blog_post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
+ end
+
def create
# if the position field exists, set this object as last object, given the conditions of this class.
if Refinery::Blog::Post.column_names.include?("position")
@@ -42,12 +46,6 @@ module Refinery
})
end
- if Refinery::Blog::Post.column_names.include?("user_id")
- params[:blog_post].merge!({
- :user_id => current_refinery_user.id
- })
- end
-
if (@blog_post = Refinery::Blog::Post.create(params[:blog_post])).valid?
(request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created',