Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed

  • Loading branch information...
commit 0ff126a2130621682feff2e3a486330937dcba0f 1 parent 97b55aa
@zenspider zenspider authored
Showing with 0 additions and 170 deletions.
  1. +0 −170 old.txt
View
170 old.txt
@@ -1,170 +0,0 @@
-= OLD STUFF FOLLOWS =
-
-== Make it your own ==
-
-==== Edit index page ====
-The page you are seeing at http://localhost:3000 is a static page, located at <code>public/index.html</code>.
-
-Make a change, save, and reload your browser to see it!
-
-=== Awesome! Let's ship it! ===
-From your new "suggestotron" directory, create a local git repository:
-
-<code><pre>
-git init
-</pre></code>
-
-This tells git that we want to start tracking the changes to this directory.
-
-=== A little note about gitignore ===
-
-Whenever we commit a project, git tracks every file by default. There are, however, files that we'd rather leave untracked (or, ignored).
-There is a hidden file in your app called "gitignore" that has a period as its first character in its filename to hide it from your normal directory view (this is why you didn't see it if you looked at your directory list earlier)
-The entries in the "gitignore" file tell git what to avoid when tracking the changes of our project files.
-
-If you open the ".gitignore" file, you'll see this:
-<code><pre>
-.bundle
-db/*.sqlite3
-log/*.log
-tmp/**/*
-</pre></code>
-
-=== Making the first commit ===
-
-After we've done that, we can proceed with our first commit by entering the following lines into the terminal:
-<code><pre>
-git add .
-git commit -m "basic web application"
-</pre></code>
-
-This saves a snapshot of the application to git. Let's check to make sure that everything was committed.
-
-<code>
- git status
- git log
-</code>
-
-<code>git status</code> tells you whether you've made changes that haven't been saved in git. Currently it should show you something like this:
-<code>
- # On branch master
- nothing to commit (working directory clean)
-</code>
-
-<code>git log</code> shows you a history of all your commits. You should see one entry - the commit you just made.
-
-To exit <code>git log</code>, hit the letter 'q'.
-
-Once you've checked that, it's time to deploy to Heroku!
-
-<pre>
-heroku create
-git push heroku master
-</pre>
-
-=== A Quick Look at Your Database ===
-
-You can also access the database through the command line:
-
- rails dbconsole
-
-=== Deploy Your Application ===
-
-Don’t forget, "commit early, deploy often." Here's how:
-<code><pre>
-git add .
-git commit -m "topic crud"
-git push heroku master
-heroku rake db:migrate
-</pre></code>
-If you run into error, "uninitialized constant rake::DSL" then add following line to Rakefile above "require 'rake' ":
-"require 'rake/dsl_definition' ".
-
-Congratulations! You have built '''and deployed''' a web application that works with a relational database.
-
-
-
-=== A closer look ===
-
-Rails allows you to easily invoke an interactive console with all of the Rails libraries and your application code loaded:
-<code><pre>
- rails console
-</pre></code>
-
-Let's add in some logging so that we can see what is happening in the database:
-<code><pre>
-ActiveRecord::Base.logger = Logger.new(STDOUT)
-</pre></code>
-
-Let’s open the console and look at the model that is defined here: <code>app/models/topic.rb</code>
-<code><pre>
->> t = Topic.new
-=> #<Topic id: nil, title: nil, description: nil, created_at: nil, updated_at: nil>
->> t.title = "My topic"
-=> "My topic"
->> t.description = "this is really cool"
-=> "this is really cool"
->> t.save
-</pre></code>
-
-Notice that the Topic class has title and description attributes which you did not need to explicitly declare in the class. This is handled by ActiveRecord which implements ORM (Object Relational Mapping) in Rails.
-
-
-
-== Next feature: creating a topic ==
-
-=== Commit & Push ===
-Congratulations! This is definitely a checkpoint. Time to commit to git and push your changes out to Heroku.
-<code>
- git add .
- git commit -m "ZOMG first feature passes!!1!!11"
- git push heroku master
-</code>
-
-(Run ‘heroku rake db:migrate --app <app_name>’ to bring over changes in the migration files under Feature 1.)
-
-== Next feature: the Topics page ==
-
-=== Commit & Push ===
-Another checkpoint! Time to commit to git and push your changes out to Heroku.
-<code>
- git add .
- git commit -m "Topic titles are now links. for srs."
- git push heroku master
-</code>
-
-== Next feature: allow voting on a topic ==
-
-=== How will we build this feature? ===
-
-* Each vote will be an object (row in database table)
-* When someone votes on a topic, we'll create a new vote object and save it
-* Each vote is associated with a specific topic
-
-
-
-=== Add votes ===
-
-Check it out in <code>rails console</code>:
-
-<code><pre>
->> t = Topic.new(:title => "My Topic")
-=> #<Topic id: nil, title: "My Topic"), description: nil, created_at: nil, updated_at: nil>
->> t.votes
-=> []
->> t.votes.build
-=> #<Vote id: nil, topic_id: nil, created_at: nil, updated_at: nil>
->> t.votes
-=> [#<Vote id: nil, topic_id: nil, created_at: nil, updated_at: nil>]
->> t.save
-=> true
->> t.votes
-=> [#<Vote id: 2, topic_id: 2, created_at: "2010-02-22 01:42:27", updated_at: "2010-02-22 01:42:27">]
-</pre></code>
-
-== What Next? ==
-
-=== Resources and Next Steps ===
-
- http://bit.ly/ruby-resources
-
Please sign in to comment.
Something went wrong with that request. Please try again.