>
> > Well you should have, you should have used rails migrations to create
> > the db, unless this is a legacy database. Create schema.rb by running
> > rake db:schema:dump
> > and post it here, though whether this is anything to do with the
> > problem is unlikely.
>
> Also post model/pack.rb please.
>
> Colin
>
> Thanks Colin for your fast answer and your care.
>
I just created schema.rb. Here I send its content:
> --------------------------------------------------------------
>
> ActiveRecord::Schema.define(:version => 20110110162357) do
>
> create_table "packs", :id => false, :force => true do |t|
> t.integer "id", :null => false
> t.string "nombre", :limit => 40
> t.string "path", :limit => 250
> end
>
> create_table "sessions", :force => true do |t|
> t.string "session_id", :null => false
> t.text "data"
> t.datetime "created_at"
> t.datetime "updated_at"
> end
>
> add_index "sessions", ["session_id"], :name =>
> "index_sessions_on_session_id"
> add_index "sessions", ["updated_at"], :name =>
> "index_sessions_on_updated_at"
>
> end
> --------------------------------------------------------------
>
2.- The content of model/pack.rb
--------------------------------------------------------------
class Pack < ActiveRecord::Base
def self.lisapp
res = self.find :all
ar = []
res.each { |arap| ar << [arap[1], arap[0]] }
ar.sort
end
end
--------------------------------------------------------------
The method lisapp is not used any more. Instead I use, before the error is
generated
@albums = Pack.find :all
and it works. Problem is with :
Pack.find 1 ( or id)
Gato Pardo
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.