Sha256: cecc1a360ef43284a7fa49aafa6078641471259173fe30e23d2bfe84c5148980

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

require_dependency "iro/application_controller"


class Iro::ProfilesController < 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

7 entries across 7 versions & 1 rubygems

Version Path
iron_warbler-2.0.7 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.6 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.5 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.4 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.3 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.2 app/controllers/iro/profiles_controller.rb
iron_warbler-2.0.1 app/controllers/iro/profiles_controller.rb