def update
      @record = Post.find(params[:id])
      @record.additional_data(params[:additional_data])
      @record.deal_with_cover(params[:has_cover_image])

      respond_to do |format|

        if @record.update_attributes(page_params)

          format.html { redirect_to edit_admin_page_path(@record.id), notice: I18n.t("controllers.admin.pages.update.flash.success") }

        else
          format.html {
            # add breadcrumb and set title
            add_breadcrumb I18n.t("controllers.admin.pages.edit.breadcrumb")
            @record.post_title.blank? ? I18n.t("controllers.admin.pages.edit.title_blank") : I18n.t("controllers.admin.pages.edit.title", post_title: @record.post_title)
            @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])
      @record.deal_with_cover(params[:has_cover_image])

      respond_to do |format|

        if @record.update_attributes(page_params)

          format.html { redirect_to edit_admin_page_path(@record.id), notice: I18n.t("controllers.admin.pages.update.flash.success") }

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

      end
    end
updates the post object with the updates params