RUBY ON RAILS GET IDS TO MY DATABASE

I want to save the IDS of my 3 models to my table DETAILS between these,
my BD is Mysql.
SUBJECTS--MALLAS--LEVELS-------->SUBJECT_ID--_MALLA_ID--_LEVEL_ID

In the view MALLA, i list my subjects, mallas and levels, and in the
controller MALLA i try to get save the arrays to
subjects_mallas_levels.

Why have you posted this again? I have replied to your first posting.

Colin

Hi Colin, really ?? sorry, I tried to simplificate my question...!

Please, if you know how to solve, tell me men.

See my reply to your initial posting.

Colin

The trouble Colin is I accidentally deleted my first post, it was the
first time i signed up, so i was trying to know how the forum works.

Please man help me with that, really I need to solve it for my thesis.

The trouble Colin is I accidentally deleted my first post, it was the
first time i signed up, so i was trying to know how the forum works.

Please man help me with that, really I need to solve it for my thesis.

Please quote the previous message when replying as this is actually a
mailing list not a forum, though you may be accessing it using a
forum-like interface. My reply was:

You need to show us the exact error and the line of code it is failing
on (with the lines around it). First, though, have a look at the
Rails Guide on Debugging which will show you techniques that you can
use to debug your code.

Colin

Thanks for you replying Colin:

Look, this's my message of error:

NoMethodError in MallacurricularesController#create
undefined method `save' for []:ActiveRecord::Relation

Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"CEX4yZeFmrSOspseMm2/d8rzPzu/3FYI2w8d7XZ1Ji0=",
"malla"=>{"clase_id"=>"1",
"subjects_ids"=>["3",
"4",
"5"]},
"level"=>"3",
"commit"=>"GUARDAR"}

The parameters looks good, and my controller is:

  def new
    @asignatura = Asignatura.find(:all)
    @clase = Clase.find(:all)
    @nivel = Nivel.find(:all)
    @malla = Malla.new
  end

def create
     @malla = Malla.new(params[:malla])
     @subject = @malla.subjects(params[:subject_ids])
     @level = @malla.levels(params[:level])

       if @malla.save and @subject.save and @level.save
       redirect_to mallacurriculares_menu_principal_admin_path, :notice
=> 'MALLA created'
       end
  end

In my controller i want to save the "ids" that i chose in the view form
to my model: subject_malla_level.

And i dont know how to do it, please help men :frowning: