I think, my method create is wrong in controller MALLA
I want to save the ids selected in the view malla from the controller
MALLA.
def create
params[:malla][:level][:subject_ids]
@malla = Malla.new(params[:subject_ids][:level][:malla])
if @malla.save
redirect_to mallacurriculares_menu_principal_admin_path, :notice
=> ‘MALLA CREATED’
end
end
AND IN MY VIEW MALLA I HAVE:
<%=form_for @malla , :url => {:action=>“create”} do |f| %>
<% for c in @class %>
<%=f.radio_button :clase_id, c.id%> <%=c.tip_mall_descrip%>
<% end %>
<% for n in Level.find(:all) %>
<%=radio_button_tag :level, n.id%><%= n.level_number %>
<%end%>
<% for a in @subject%>
<%=check_box_tag
“malla[subject_ids][]”,a.id,@malla.subject.include?(a)%>
<%= a.subject_name%>
<%end%>
<%=f.submit “SAVE”%>
<%end%>
My problem is, when I chose the options in my checkbox and radiobutton,
I can’t get their “ids” in my table ASIGNATURAS_MALLAS_NIVELS, sometimes
I get this errors:
Please, someone help me, i’m doing my thesis.