Class: Dust::DashboardController

Inherits:
AuthenticationController show all
Defined in:
app/controllers/dust/dashboard_controller.rb

Instance Method Summary collapse

Methods inherited from AuthenticationController

#not_authenticated, #permission_denied, #try_return_to_previous_page

Instance Method Details

#showObject



8
9
10
# File 'app/controllers/dust/dashboard_controller.rb', line 8

def show
  @options = SiteWide.variables_by_category
end

#updateObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/dust/dashboard_controller.rb', line 13

def update
  @site_wide = Dust::Builder::SiteWide.new(:options => params[:options])

  if @site_wide.update
    flash[:notice] = "Successfully saved site wide variables!"
    redirect_to dust_dashboard_url
  else
    @options = @site_wide.variables.group_by{ |i| i.category }
    render :action => :show
  end
end