-
What does
MVC
stand for? minimal viable product -
What is the purpose of
MVC
? find the core essentials of app -
What is the command you would use to generate a new rails application called "twitter"? rails new twitter -d postgresql
-
Which file do you edit to add additional gems to your rails app? Gemfile
-
What is the purpose of
.gitignore
file? to exclude file from being pushed to github -
What is the
app/assets
folder used for? it holds content owned by the application in the form of images, JS, and css -
What is the
vendor/assets
folder used for? to hold content outside of the application such as code for JS plugins or css -
What is the command to create my initial database? rake db:create
-
What is the name of the file where I define my home page url? routes.rb
-
What does
Rails.env
return when developing locally? "development" -
What does
Rails.root
return when developing locally? the folder path -
What is the command you use to do irb with the rails application preloaded for you? rails c
-
What is the command to create a new model called
Tweet
with a message string? rails g model Tweet message (i think string is defaulted right?) -
What is the command to update your database with changes? rake db:migrate
-
What is the purpose of migrations? to take files from your console to the database
-
What is the job of the controller? to relay information from the Models to the views
-
What is the command to generate a controller called
tweets
? rails g controller Tweets -
Define a route for showing all the tweets in our controller and a route for showing a specific tweet: <%= @tweets.each do |tweet| %> <%= link_to(tweet.name) %>
<%= link_to(tweet.name, tweet_path(tweet.id)) %>
-
What is the default view templating engine in rails? erb
-
What is the code to validate a tweet's message is reqired when making a new tweet? validates :name, presence: true
-
What does
REST
stand for? representational state transfer -
What is the purpose of
rake
? it is a tool that can preform tasks in rails; we use many predefined tasks -
What folder can we use in our rails app to define custom rake tasks? lib -> tasks
-
In rails, the method
number_to_currency
is a what? helper method -
In rails, when using a relational database, all models inherit from what class? I thought models were classes, i'm confused!
-
What is the command to create a new migration file for adding location to a tweet? rails generate migration AddLocation location:string
-
In a migration file, what is the code to add a string location to the
tweets
table? def change add_column : :tweets, :location, :string end -
In
SQL
, how would I query for the number of records in mytweets
table? -
In
rails
, how would I query for the number of records in myTweet
model? -
What is the command to start your rails application? rails s
-
What port does your rails application run on by default locally? localhost:3000
-
Name 3 types of database associations: relational, hierarchial, object-oriented
-
What is
params
? a way to retrieve user specified data -
What is
flash
? a way to pass temporary objects between actions; great for notices and alerts -
Where would you write a custom helper method? application_controller.rb
-
What is the
SQL
code for finding all tweets where the location is equal to "Salt Lake"? select * from tweets where location='Salt Lake'; -
What is the
rails
code for finding all tweets where the location is equal to "Salt Lake"? Tweet.where("location='Salt Lake'") -
What is the
rails
code for finding only a max of 5 tweets where the location begins with "Salt Lake"? @tweets = Tweet.where("location='Salt Lake'").per[5] -
When using a secific query over and over it's best to make it into a method. What type of method do we use? private
-
I have this route
tweet GET /tweets/:id(.:format) tweets#index
. What two helper methods can I use? debug collection_select -
What does the parenthesis in a route denote? a helper i think
-
What do the symbols in a route mean? it shows what to call upon
-
All pages use which HTTP verb? GET
-
Which helper method will create an html anchor tag for us? link_to
-
Which helper method will create an html form tag for us? form_tag
-
Which helper method will create an html password field for us? password_field_tag
-
The instance variable
@tweets
can most likely be used like what data type? hash -
What construct can we use in a view to write ruby code? erb tags <% %> <%= %>
-
What is the code to iterate over a
@tweets
variable in a view? <% @tweets.each do |tweet| %> -
What is the method to save a newly created record to the database in rails? .save
-
What is the method to remove a record from the database in rails? .destroy
-
What is the method to update some of the attributes of an object in rails? update_attribute
-
Aside from a tweet, what other model could twitter possibly use? User
-
What is the command to see all of the urls defined in my rails application? ?
-
What file do I use to update the styles for my application? application.css
-
Is your brain hurting yet? ja
-
What is the current version of rails? 2.1.2
-
When was rails created? 2004
-
Who created rails? David Hansson
-
What is the purpose of scaffolding? to do quick and dirty app building for planning purposes
-
What is a partial? a partial file lets you organize and reuse view code
-
How can you tell a file is a partial? if it starts with _ and ends with .html.erb
-
PostgeSQL is what type of database? relational
-
Name another database engine similar to PostgreSQL. MySQL
-
Name a database engine that is a different type from PostgreSQL: NoSQL
-
Are you ready for the last question? :P
-
What is a
foreign key
used for? used to add a column from one table to another -
Did you really think question 67 was the last? :P
-
What method in the the routes file do I use to define my home page? root 'homepage#index'
-
What does SASS stand for? syntactically awesome style sheets
-
What is SASS used for? it is used to treat css more like a language and then convert it back to css
-
What gem group would you put
pry-rails
into? :development -
How would you create a static "about" page? i.e. what steps would be needed? create a new controller call is something like site, give it an index and about view add get '/about' => 'site#about' to the routes.rb file
Last active
August 29, 2015 14:02
-
-
Save lcbunch/f2ba88da396c03558af0 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment