Sha256: b9e7fcaeee7804db91984235baacfa233fd032871a69732cd957e7bbb0f37ddc

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

# -*- encoding : utf-8 -*-

require 'sinatra/base'
require 'haml'
require 'yaml'
require 'mimetype_fu'

module Gitdocs
  class SettingsApp < Sinatra::Base
    get('/') do
      haml(
        :settings,
        locals: { conf: settings.manager, nav_state: 'settings' }
      )
    end

    post('/') do
      settings.manager.update_all(request.POST)
      redirect to('/')
    end

    delete('/:id') do
      id = params[:id].to_i
      halt(404) unless settings.manager.remove_by_id(id)
      redirect to('/')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gitdocs-0.5.0 lib/gitdocs/settings_app.rb