This is an array of objects, complete like this :
***********************************
my_fileXml_array = Array.new
myFileXml = FileXml.new
myFileXml.name = "TEST"
myFileXml.description = "TEST"
my_fileXml_array << myFileXml
***********************************
But if the datatype was a problem, I could'nt access to the session
key/value in my "_infos_fichiers_xml.html.erb"view.
Just to make a complete answer, these objects are some XmlFile, defined
like that :
***********************************
class XmlFile < ActiveRecord::Base
has_many :wiff_files
has_many :protein_in_experiments
belongs_to :experiment
serialize :bias_infos
end
***********************************
class CreateXmlFiles < ActiveRecord::Migration
def self.up
create_table :xml_files do |t|
t.string :name
t.text :description
...
t.references :experiment
t.timestamps
end
end
def self.down
drop_table :xml_files
end
end
***********************************
I only have the NoMethodError when accessing to the session key/value in
an another function than the one where affectation was made, but in the
same controler. Is it an envidence ?
That you for your help !
Frederick Cheung wrote:
> On Jun 2, 2:54�pm, Chdem Chdem <li...@ruby-forum.com> wrote:
>> [code]def analysis_repository
>> � � � .....
>> � � � session[:list_xml] = create_XML_file_obj(false)#put an array of
>> XmlFile objects in the session
>
> Is this actually an array or an association proxy that looks like an
> array ?
>
> Fred
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment