Sha256: 81a89fecfe1c8acbc9e70e133df0b6de90c7a321c71485fabe62c4164de18c20
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 KB
Contents
# Samouczek 1. {%= link_to "Rozkład jazdy", "/intro" %} 1. {%= link_to "Pliki tekstowe dla data persistence", "/using-plain-text-files-for-data-persistence" %} ## Datamapper <blockquote> {%= image_tag "/images/conan_doyle.jpg", :alt => "[Sir Arthur Conan Doyle]" %} <p> I never guess. It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts. </p> <p class="author">— Sir Arthur Conan Doyle</p> </blockquote> ## Instalacja Instalujemy następujące gemy: sudo gem install dm-core dm-more sudo gem install do_sqlite3 do_postgres sudo gem install dm-validations dm-timestamps sudo gem install dm-aggregates dm-types oraz trochę wtyczek. Wszystkie są [opisane tutaj](http://datamapper.org/doku.php?id=docs:more). ## Zestawianie połączenia z bazą SQLite :::ruby # baza danych w RAM DataMapper.setup(:default, 'sqlite3::memory:') # baza danych plikiem DataMapper.setup(:default, "sqlite3:///#{Dir.pwd}/test.sqlite") PostgreSQL :::ruby # Postgres 8.2+ DataMapper.setup(:default, 'postgres://localhost/test') **Uwaga**: You may be wondering how to be more specific about your database connection. The second argument can be a hash, containing :host, :adapter, :database, :username, :password, :socket, etc. These are database-specific but this ought to get you going.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
wbzyl-datamapper-tutorial-0.0.10 | lib/views/main.rdiscount |
wbzyl-datamapper-tutorial-0.0.11 | lib/views/main.rdiscount |
wbzyl-datamapper-tutorial-0.0.9 | lib/views/main.rdiscount |