i have database file name tel-directory.sqlite and its text file in db
folder so i went to config/database.yaml changed it to
db/tel-directory.sqlite in development then create a model
telephone_records skipping migration then i configured controller and
its view but i get something no table found telephone_records i used
sqlite manager i get records tough when i go and check tel-directory
file.sqlite with 0kb is created what is going wrong i am not getting it.
so i decided to copy th contents from old datbase to new datbase file it
display disk image is malformed can you suggest me what are changes i
must do to display all the record in the browser.
development:
adapter: sqlite3
database: db/tel-directory.sqlite3
pool: 5
timeout: 5000
model
class TelephoneRecords < ActiveRecord::Base
# attr_accessible :title, :body
end
controller
class TelephoneController < ApplicationController
def index
@telephone_records = TelephoneRecords.all
end
end
index
<%= debug(@telephone_records)%>
once agin i tried configuring active record like this
class TelephoneRecords <
ActiveRecord::Base.establish_connection(:adapter => ‘sqlite3’,:database
=> ‘db/teldirectory.sqlite3’)
end
then i get
wrong argument type ActiveRecord::ConnectionAdapters::ConnectionPool
(expected Class)