Skip to content

Commit f293f24

Browse files
committed
assignment task schneems#3 completed
1 parent 39198f4 commit f293f24

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ By now you should have several ERB blocks that have a variable assignment in the
272272
<% first_product = Product.first %>
273273

274274
Try moving one or more to different places in the view file, what happens? What if you move one of them to the bottom? What if you move ALL of them to the top? Does one break? Does one look/feel better?
275+
A: It throws an error if a variable is declared after a statement calling it.
275276

276277
Commit the results to git.
277278

app/views/products/index.html.erb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
<% first_product = Product.first %>
2+
<p>
3+
Product Name: "<%= first_product.name %>" costs $<%= first_product.price %>
4+
</p>
5+
6+
<p>
7+
The seller for this product is named '<%= first_product.user.name %>'.
8+
</p>
9+
10+
<% cheap_product = Product.where('price > 1').first %>
11+
<p>
12+
The cheap product's name is <%= cheap_product.name %> and costs $<%= cheap_product.price %>.
13+
</p>
14+
15+
<p>
16+
There are a total of <%= Product.count %> products in our catalogue!
17+
</p>
18+
119
<h2> I AMA View </h2>
220
<h2> Hello world </h2>
321
<p>

0 commit comments

Comments
 (0)