1
0
Fork 0
dokkan-data-rails/app/controllers/leader_skills_controller.rb

52 lines
966 B
Ruby
Raw Normal View History

2015-10-06 13:55:12 -04:00
class LeaderSkillsController < ApplicationController
before_action :set_leader_skill, only: [:show, :edit, :update, :destroy]
def index
@leader_skills = LeaderSkill.all
end
def show
end
def new
@leader_skill = LeaderSkill.new
end
def create
@leader_skill = LeaderSkill.new(leader_skill_params)
if @leader_skill.save
redirect_to leader_skills_path, notice: 'Leader Skill was created'
else
render :new
end
end
def edit
end
def update
if @leader_skill.update(leader_skill_params)
redirect_to leader_skills_path, notice: 'Leader Skill was updated'
else
render :edit
end
end
def destroy
@leader_skill.destroy
redirect_to leader_skills_path, notice: 'Leader Skills was deleted'
end
private
def leader_skill_params
2015-10-07 16:17:40 -04:00
params.require(:leader_skill).permit(:description)
2015-10-06 13:55:12 -04:00
end
def set_leader_skill
@leader_skill = LeaderSkill.find(params[:id])
end
end