Sha256: 44ad9cc178105928a39774093b0b41ec29b4a4fd582de16f15fac7123afaca8e

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

module TypeStation
  module Admin
    class PagesController < ::TypeStation::AdminController
      
      def update
        @page = TypeStation::Page.find(params[:id])

        if @page.update_contents(contents)
          render json: { status: :success }, status: :ok
        else
          render json: @page.errors, status: :unprocessable_entity
        end
      end

      private

      def contents
        [params[:contents]].flatten
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
type_station-0.0.1.pre app/controllers/type_station/admin/pages_controller.rb