Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

To post your Question Join Classroom
Lesson Topics's No:-  |1 | 2|Last
Lessons:- Named Routes

Named Routes

Let’s put the named routes created in Section 5.3.2 to work in our layout. This will entail filling in the second arguments of the link_to functions with the proper named routes. For example, we’ll convert


< % =    link -to   " About ",  '#'  % >



< % =   link- to  "About" ,  about  path  %>  


and so on.

              We’ll start in the header partial, _header.html.erb (Listing 5.24), which has links to the Home and Help pages. While we’re at it, we’ll follow a common web convention and link the logo to the Home page as well.  





We won’t have a named route for the ‘‘Sign in’’ link until Chapter 8, so we’ve left it as ’#’ for now.

             The other place with links is the footer partial, _footer.html.erb, which has links for the About and Contact pages (Listing 5.25).

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

  Students (0)