How to customize arguments with a partial in the normal page when you call the partial:
<%= partial "banner", :locals => { :name => "Syllabus", :amount => 34 } %>
in the partial file:
<h3> ,%= name %> </h3>
<p> Costs <%= "$#{amount}.00" %></p>
What is Layout It is a file that can make a consistent structure across every page in a website
How do you label where there's page specific stuff in <%= yield =>
Layout.erb?
How do you fix the issue of using a layout when each Ruby variable current_page
page needs a diff <title>? ie: current_page.path
So in the actual page file you put:
<title><%= current_page.data.title %> </title>
and in the layout.erb:
---
title: "Contact Info"
---
What is the main difference in syntax when using Not having to use tags because that part is in layout
middleman?
What are some common plain text conventions? blank lines between paragraphs
Underlining: - or =
Emphasize: words, _words_, *words*
Links: [text](url)
unordered lists: * or -
ordered lists: 1. 2. 3.
What formalizes these shortcuts? Markdown
What are CSS magic numbers? They are basically variables so you don't have to keep writing the same hex for
a color for example
How do you declare a CSS magic number? $primary: #ff14a6
then use:
h1 {color: $primary;}
What does SASS allow for CSS? declaring diff css styles in one {} under a class name
, CSE 3901 Midterm 2 Exam
How can you solve the problem of you have files in subdirectory data/ that define variables
parameterized/repeated content? ie #data/dates.yml
term: "Spring 2017"
then:
<% data.dates.term %>
how to solve the problem of repeated structure like use code to iterate over an array and add each row
rows in a table <% meetings.each do |meet| %>
<tr><td> <%= meet.date %> </td>...
what does link_to do? its a helper function for a href
<%= link_to('About us', '/about.html') %>
#=> <a href='/about.html'>About us</a>
TESTING FRAMEWORKS SECTION ---
What are two different testing libraries for Ruby? MiniTest
RSpec
Describe MiniTest -comes built in
-looks like JUnit
Describe RSPec -installed as a library (a gem)
-look different from JUnit and Ruby
What is different about RSpec's view? test cases define expected behavior-- they are the spec
What do you have to require for MiniTest? runner and UUT
require 'minitest/autorun' #the test runner
require 'card' #the UUT
What is Test fixture in MiniTest Tests subclass of MiniTest::Test
class TestCard < MiniTest::Test
What is Test case in MiniTest? a method in the fixture