1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  def edit
    @character = Character.find(params[:id], :include => {:player_skills => :skill})
    stub_player_skills
    @psk = @character.player_skills
    @skill_arr = []
    @psk.each do |el|
      if el.name.nil?
        @skill_arr << el.skill.name
      else
        @skill_arr << el.name
      end
    end
  end


# Here's the "build"
ps = @character.player_skills.build(:skill_id => skill.id, :name => skill.name)