Sha256: d166f8bb18f8c74c6f1b551531dc12a17bb15519bb36a43a68ec764748bd422b

Contents?: true

Size: 726 Bytes

Versions: 4

Compression:

Stored size: 726 Bytes

Contents

class Admin::Disguise::ThemesController < ApplicationController
  unloadable

  before_filter :get_theme

  def edit
    @current_theme, @themes = Theme.available_themes(@theme)
    if @themes.empty?
      respond_to do |format|
        format.html { render :template => 'admin/themes/no_themes' }
      end
    else
      respond_to do |format|
        format.html { render :template => 'admin/themes/edit' }
      end
    end
  end

  def update
    @theme.update_attributes!(params[:theme])
    respond_to do |format|
      flash[:notice] = t('disguise.theme_updated')
      format.html { redirect_to edit_admin_theme_path }
    end
  end

  private
    def get_theme
      @theme = Theme.first || Theme.create
    end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
jbasdf-disguise-0.1.1 app/controllers/admin/disguise/themes_controller.rb
disguise-0.1.2 app/controllers/admin/disguise/themes_controller.rb
disguise-0.1.1 app/controllers/admin/disguise/themes_controller.rb
disguise-0.1.3 app/controllers/admin/disguise/themes_controller.rb