app/controllers/pulitzer/posts_controller.rb in pulitzer-0.13.1 vs app/controllers/pulitzer/posts_controller.rb in pulitzer-0.14.0
- old
+ new
@@ -4,34 +4,33 @@
before_action :get_version, only: [:edit_slug, :show_slug, :update_slug]
def index
@post_type = Pulitzer::PostType.find params[:post_type_id]
@posts = Pulitzer::Post.where(post_type: @post_type).order(id: :desc)
+ render_ajax
end
def new
@post = Pulitzer::Post.new(post_type_id: params[:post_type_id])
- render partial: 'new', locals: { post: @post }
+ render_ajax locals: { post: @post }
end
def create
@post = Pulitzer::Post.create(post_params)
Pulitzer::CreatePostContentElements.new(@post).call if @post
render partial: 'show_wrapper', locals: { post: @post }
end
def show
- render partial: 'show', locals: { post: @post }
+ render_ajax locals: { post: @post }
end
def edit
- if request.xhr?
- render partial: 'edit', locals: { post: @post }
- end
+ render_ajax locals: { post: @post }
end
def edit_title
- render partial: 'form', locals: { post: @post }
+ render partial: 'form', locals: { post: @post }
end
def update
@post.update_attributes(post_params)
render partial: 'show', locals: { post: @post }