Sha256: 7fcf2e7dbecf5cfdc7295741030d83efd30676e91778aa3def092f6bc51808df

Contents?: true

Size: 788 Bytes

Versions: 9

Compression:

Stored size: 788 Bytes

Contents

class Admin::ProfilesController < Admin::BaseController

  def index
    list
    render :action => 'list'
  end

  def list
    @profiles = Profile.find :all
  end

  def new
    @profile = Profile.new(params[:profile])
    if request.post? and @profile.save
      flash[:notice] = 'Profile was successfully created.'
      redirect_to :action => 'list'
    end
  end

  def edit
    @profile = Profile.find(params[:id])
    @profile.attributes = params[:profile]
    if request.post? and @profile.save
      flash[:notice] = 'Profile was successfully updated.'
      redirect_to :action => 'list'
    end
  end

  def destroy
    @profile = Profile.find(params[:id])
    if request.post?
      @profile.destroy if Profile.count > 1
      redirect_to :action => 'list'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
typo-5.0.1 app/controllers/admin/profiles_controller.rb
typo-5.0.2 app/controllers/admin/profiles_controller.rb
typo-5.0.3.98.1 app/controllers/admin/profiles_controller.rb
typo-5.0 app/controllers/admin/profiles_controller.rb
typo-5.0.3.98 app/controllers/admin/profiles_controller.rb
typo-5.1.1 app/controllers/admin/profiles_controller.rb
typo-5.1.2 app/controllers/admin/profiles_controller.rb
typo-5.1.3 app/controllers/admin/profiles_controller.rb
typo-5.1 app/controllers/admin/profiles_controller.rb