app/controllers/storytime/posts_controller.rb in storytime-1.0.6 vs app/controllers/storytime/posts_controller.rb in storytime-1.0.7

- old
+ new

@@ -22,11 +22,11 @@ end def show @post = if params[:preview] post = Post.find_preview(params[:id]) - # post.content = post.autosave.content if post.autosave + post.content = post.autosave.content post.preview = true post else Post.published.friendly.find(params[:id]) end @@ -39,11 +39,11 @@ return redirect_to @post, :status => :moved_permanently end @comments = @post.comments.order("created_at DESC") #allow overriding in the host app - if lookup_context.template_exists?("storytime/posts/#{@post.slug}") - render @post.slug + if lookup_context.template_exists?("storytime/#{@post.type_name.pluralize}/#{@post.slug}") + render "storytime/#{@post.type_name.pluralize}/#{@post.slug}" elsif lookup_context.template_exists?("storytime/#{@post.type_name.pluralize}/show") render "storytime/#{@post.type_name.pluralize}/show" end end