def update
      @record = Post.find(params[:id])
      @record.additional_data(params[:additional_data]) if defined?(params[:additional_data]) && !params[:additional_data].blank?
      @record.deal_with_cover(params[:has_cover_image])
      respond_to do |format|

        if @record.update_attributes(post_params)

          # assigns and unassigns categories and tags to an individual posts
          Post.deal_with_categories @record, params[:category_ids], params[:tag_ids], true
          format.html { redirect_to edit_admin_article_path(@record), notice: I18n.t("controllers.admin.articles.update.flash.success") }

        else
          format.html {
            # add breadcrumb and set title
            add_breadcrumb I18n.t("controllers.admin.articles.edit.breadcrumb")
            @action = 'update'
            flash[:error] = I18n.t('generic.validation.no_passed')
            render action: "edit"
          }
        end

      end
    end
def update
      @record = Post.find(params[:id])
      @record.additional_data(params[:additional_data]) if defined?(params[:additional_data]) && !params[:additional_data].blank?
      @record.deal_with_cover(params[:has_cover_image])
      respond_to do |format|

        if @record.update_attributes(post_params)

          # assigns and unassigns categories and tags to an individual posts
          Post.deal_with_categories @record, params[:category_ids], params[:tag_ids], true
          format.html { redirect_to edit_admin_article_path(@record), notice: I18n.t("controllers.admin.articles.update.flash.success") }

        else
          format.html {
            # add breadcrumb and set title
            add_breadcrumb I18n.t("controllers.admin.articles.edit.breadcrumb")
            @action = 'update'
            flash[:error] = I18n.t('generic.validation.no_passed')
            render action: "edit"
          }
        end

      end
    end
updates the post object with the updates params