I am learning Ruby on Rails using the textbook called “Agile Web
Development with Rails (4th edition)”. I am currently on Chapter 6. I
created the Depot application. Everything matches up with the author’s
results except for the alternating purple stripes in the product
listings page. Instead, I end up with white background for all 3
listings. I followed all the author’s instructions and rewrote all the
files as necessary.
I am wondering what needs to be changed so that the purple stripes will
be displayed in the browser.
I have a copy of that book… Post your css and html here, and I’ll try
to
walk you through this problem… In the meantime, do you have an
electronic copy of relevant files in the book. If so, why don’t you
just
do a file compare, you probably just have a typo somewhere.
Liz
Are you cycling the class of the tr or div that you are using to house
the data?
Also did you remember to define the classes in your css?
Alright, should I just show you what I have in my code files?
First try to work it out for yourself. Look at the html generated
(View Source or something similar in the browser) and make sure that
the correct html is there that should show the stripes. If that looks
correct then check your css files to make sure it looks right there.
If they both look right then show us a snippet of the html and the
relevant section of css. If the html does not look right and you
cannot see why then just post the relevant section of the view code
that generates it, along with the html it generates.
Good grief! Do you see class=‘product’> in the upper right hand corner
of
the my_results image you provided? You’ve got a missing tag or maybe a
string that hasn’t been properly wrapped with single or double quotes
somewhere NEAR or related to class=‘product’>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.