The call current_user.user_skills.new
adds a blank user_skill
to the has_many
association of current_user
. Since @user_skills
is simply a reference to current_user.user_skills
, the blank instance is included in the the unordered list when iterating after initializing the new user_skill record.
You'd be better off simply initializing a new user_skill
in the form:
<%= semantic_form_for UserSkill.new do |f| %>
<%= f.inputs %>
<%= f.actions %>
<% end %>
Then, in the create action of your UserSkillsController
, associate the user_skill
attributes with the current_user
. A bare-bones version could look something like:
def create
@user_skill = current_user.user_skills.create(params[:user_skill])
respond_with @user_skill
end