app/controllers/pulitzer/posts_controller.rb in pulitzer-0.2.2 vs app/controllers/pulitzer/posts_controller.rb in pulitzer-0.3.0
- old
+ new
@@ -1,7 +1,7 @@
class Pulitzer::PostsController < Pulitzer::ApplicationController
- before_filter :get_post, only: [:show, :edit, :update]
+ before_filter :get_post, only: [:show, :edit, :update, :processing_preview]
def index
@post_type = Pulitzer::PostType.find params[:post_type_id]
@posts = Pulitzer::Post.where post_type: @post_type
end
@@ -20,10 +20,12 @@
def show
render partial: 'show', locals: { post: @post }
end
def edit
- render partial: 'form', locals: { post: @post }
+ if request.xhr?
+ render partial: 'form', locals: { post: @post }
+ end
end
def update
@post.update_attributes(post_params)
render partial: 'show', locals: { post: @post }