aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/refinery/blog/admin/posts_controller.rb
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2012-01-17 16:56:03 +1300
committerPhilip Arndt <parndt@gmail.com>2012-01-17 16:56:24 +1300
commitb1e4fd00943a160f3eb6ce242463c0cc07a406fc (patch)
tree07fb750aa580b63d39c23589997956bf3a03594d /app/controllers/refinery/blog/admin/posts_controller.rb
parentb3a25c1b686d205fc6b8b409a8f90059ae6b934d (diff)
downloadrefinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.gz
refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.bz2
refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.zip
Fixed namespacing for Refinery conventions.
Diffstat (limited to 'app/controllers/refinery/blog/admin/posts_controller.rb')
-rw-r--r--app/controllers/refinery/blog/admin/posts_controller.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb
index 04ee663..2ed2b98 100644
--- a/app/controllers/refinery/blog/admin/posts_controller.rb
+++ b/app/controllers/refinery/blog/admin/posts_controller.rb
@@ -16,7 +16,7 @@ module Refinery
before_filter :check_category_ids, :only => :update
def uncategorized
- @blog_posts = Refinery::Blog::Post.uncategorized.page(params[:page])
+ @posts = Refinery::Blog::Post.uncategorized.page(params[:page])
end
def tags
@@ -35,21 +35,21 @@ module Refinery
end
def new
- @blog_post = ::Refinery::Blog::Post.new(:author => current_refinery_user)
+ @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")
- params[:blog_post].merge!({
+ params[:post].merge!({
:position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1)
})
end
- if (@blog_post = Refinery::Blog::Post.create(params[:blog_post])).valid?
+ if (@post = Refinery::Blog::Post.create(params[:post])).valid?
(request.xhr? ? flash.now : flash).notice = t(
'refinery.crudify.created',
- :what => "'#{@blog_post.title}'"
+ :what => "'#{@post.title}'"
)
unless from_dialog?
@@ -63,7 +63,7 @@ module Refinery
end
end
else
- render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>"
+ render :text => "<script>parent.window.location = '#{refinery_blog_admin_posts_url}';</script>"
end
else
unless request.xhr?
@@ -71,7 +71,7 @@ module Refinery
else
render :partial => "/refinery/admin/error_messages",
:locals => {
- :object => @blog_post,
+ :object => @post,
:include_object_name => true
}
end
@@ -80,11 +80,11 @@ module Refinery
protected
def find_all_categories
- @blog_categories = Refinery::Blog::Category.find(:all)
+ @categories = Refinery::Blog::Category.find(:all)
end
def check_category_ids
- params[:blog_post][:category_ids] ||= []
+ params[:post][:category_ids] ||= []
end
end
end