Sha256: 8c13e9f1f1977de720769ab5c7aacefcfb4842972e5c4f742f691e51ae0e00de

Contents?: true

Size: 550 Bytes

Versions: 5

Compression:

Stored size: 550 Bytes

Contents

class AdminSettingsPage < Page
  # TODO: when Site is changed to become a normal MongoRecord, this should
  # be replaced with a plain Page, no need for anything special
  respond_to :get do
    with :html do
      return unless user_allowed_to?(:view)
      layout('html', false).render(self)
    end
  end
  
  respond_to :put do
    with :html do
      return unless user_allowed_to?(:update)
      site.name = params['name']
      site.domains = params['domains']
      site.save      
      response.redirect '/admin/settings'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel_admin-0.0.7 lib/models/admin_settings_page.rb
yodel_admin-0.0.5 lib/models/admin_settings_page.rb
yodel_admin-0.0.4 lib/models/admin_settings_page.rb
yodel_admin-0.0.2 lib/models/admin_settings_page.rb
yodel_admin-0.0.1 lib/models/admin_settings_page.rb