Both sides previous revisionPrevious revisionNext revision | Previous revision |
building_a_basic_ruby_on_rails_application [2021/03/22 20:38] – hc9 | building_a_basic_ruby_on_rails_application [2024/09/02 23:01] (current) – ' hc9 |
---|
</code> | </code> |
| |
The first command creates our project's directory tree under the '''~/html/bookmarks<nowiki>'</nowiki>'' directory. Then we create a symlink from this directory, to '''~/html/rails<nowiki>'</nowiki>'' so that the SDF utility scripts will be able to find, and work with this project. ( [[#appendix_sdf_utils| More info]] ) | The first command creates our project's directory tree under the '''~/html/bookmarks<nowiki>'</nowiki>'' directory. Then we create a symlink from this directory, to '''~/html/rails<nowiki>'</nowiki>'' so that the SDF utility scripts will be able to find, and work with this project. ( [[#appendix_asdf_utility_scripts| More info]] ) |
| |
The '''--database=sqlite3<nowiki>'</nowiki>'' argument to the '''rails<nowiki>'</nowiki>'' executable, informs Rails to configure the new project to use an SQLite3 database backend. If you have 'dba' membership then you can use MySQL as your backend by substituting '''sqlite3<nowiki>'</nowiki>'' with '''mysql<nowiki>'</nowiki>''. This tutorial will however focus in using SQLite3 as it is available to all MetaARPA members. If you are going to use MySQL as your database backend, then you'll have to read [[#appendix_database_conf|this]] in order to configure your backend properly. | The '''--database=sqlite3<nowiki>'</nowiki>'' argument to the '''rails<nowiki>'</nowiki>'' executable, informs Rails to configure the new project to use an SQLite3 database backend. If you have 'dba' membership then you can use MySQL as your backend by substituting '''sqlite3<nowiki>'</nowiki>'' with '''mysql<nowiki>'</nowiki>''. This tutorial will however focus in using SQLite3 as it is available to all MetaARPA members. If you are going to use MySQL as your database backend, then you'll have to read [[#appendix_bconfiguring_a_database|this]] in order to configure your backend properly. |
| |
The final command changes your working directory to your new projects' root. The rest of the commands in this tutorial rely on you being at this location in order to execute correctly. | The final command changes your working directory to your new projects' root. The rest of the commands in this tutorial rely on you being at this location in order to execute correctly. |
Next we need to edit the '''db/migrate/001_create_links.rb<nowiki>'</nowiki>'' file. Files located under the '''db/migrate<nowiki>'</nowiki>'' directory are used to perform revision changes on your project's database. This file will allow us to specify our databases table without the need for any SQL, and, if required, roll our database back to before this migration occurred. | Next we need to edit the '''db/migrate/001_create_links.rb<nowiki>'</nowiki>'' file. Files located under the '''db/migrate<nowiki>'</nowiki>'' directory are used to perform revision changes on your project's database. This file will allow us to specify our databases table without the need for any SQL, and, if required, roll our database back to before this migration occurred. |
| |
==== Edit '"db/migrate/001_create_links.rb"' ==== | === Edit 'db/migrate/001_create_links.rb' === |
| |
<code> | <code> |