Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3|Last
Lessons:-Conclusion-Exercises

  Exercises

We’ve covered enough material now that there is a combinatorial explosion of possible extensions to the application. Below are just a few of the many possibilities.

1. Add tests for the sidebar micropost counts (including proper pluralization).

2. Add tests for micropost pagination.

 

           Figure 10.18 The (broken) site layout with a particularly long word.

 

3. Refactor the Home pageto useseparate partials for thetwo branches of the if-else statement.

4. Write a test to make sure delete links do not appear for microposts not created by the current user.

5. Using partials, eliminate the duplication in the delete links from Listing 10.46 and Listing 10.47.

6. Very long words currently break our layout, as shown in Figure 10.18. Fix this problem using the wrap helper defined in Listing 10.50. Note the use of the raw method to prevent Rails from escaping the resulting HTML, together with the sanitize method needed to prevent cross-site scripting. This code also uses the strange-looking but useful ternary operator (Box 10.1).

7. (challenging) Add a JavaScript display to the Home page to count down from 140 characters.

 
 
 
image
Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student
Explore
 

  Students (0)