Sha256: 897b2a95393e6eaa0daa1b1a3d18090dc8e447b40f1b704175fd97b09bdf030f

Contents?: true

Size: 1.17 KB

Versions: 36

Compression:

Stored size: 1.17 KB

Contents

class Iro::ProfilesController < Iro::ApplicationController
  before_action :set_profile, only: [:show, :edit, :update, :destroy]

  # GET /profiles
  def index
    @profiles = Profile.all
  end

  # GET /profiles/1
  def show
  end

  # GET /profiles/new
  def new
    @profile = Profile.new
  end

  # GET /profiles/1/edit
  def edit
  end

  # POST /profiles
  def create
    @profile = Profile.new(profile_params)

    if @profile.save
      redirect_to @profile, notice: 'Profile was successfully created.'
    else
      render :new
    end
  end

  # PATCH/PUT /profiles/1
  def update
    if @profile.update(profile_params)
      redirect_to @profile, notice: 'Profile was successfully updated.'
    else
      render :edit
    end
  end

  # DELETE /profiles/1
  def destroy
    @profile.destroy
    redirect_to profiles_url, notice: 'Profile was successfully destroyed.'
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_profile
      @profile = Profile.find(params[:id])
    end

    # Only allow a list of trusted parameters through.
    def profile_params
      params.require(:profile).permit(:email, :role_name, :user_id)
    end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
iron_warbler-2.0.7.45 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.43 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.42 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.41 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.40 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.39 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.38 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.37 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.36 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.35 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.34 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.33 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.32 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.31 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.30 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.29 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.28 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.27 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.26 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.7.25 app/controllers/iro/profiles_controller.rb