Class: Iro::ProfilesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/iro/profiles_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#home, #schwab_sync

Instance Method Details

#createObject

POST /profiles



24
25
26
27
28
29
30
31
32
# File 'app/controllers/iro/profiles_controller.rb', line 24

def create
  @profile = Profile.new(profile_params)

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

#destroyObject

DELETE /profiles/1



44
45
46
47
# File 'app/controllers/iro/profiles_controller.rb', line 44

def destroy
  @profile.destroy
  redirect_to profiles_url, notice: 'Profile was successfully destroyed.'
end

#editObject

GET /profiles/1/edit



20
21
# File 'app/controllers/iro/profiles_controller.rb', line 20

def edit
end

#indexObject

GET /profiles



6
7
8
# File 'app/controllers/iro/profiles_controller.rb', line 6

def index
  @profiles = Profile.all
end

#newObject

GET /profiles/new



15
16
17
# File 'app/controllers/iro/profiles_controller.rb', line 15

def new
  @profile = Profile.new
end

#showObject

GET /profiles/1



11
12
# File 'app/controllers/iro/profiles_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /profiles/1



35
36
37
38
39
40
41
# File 'app/controllers/iro/profiles_controller.rb', line 35

def update
  if @profile.update(profile_params)
    redirect_to @profile, notice: 'Profile was successfully updated.'
  else
    render :edit
  end
end