Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

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

Now for the implementation.4 In order to forward users to their intended destination, we need to store the location of the requested page somewhere, and then redirect to that location instead. We accomplish this with a pair of methods, store_location and redirect_back_or, both defined in the Sessions helper (Listing 9.18)

 

 

The storage mechanism is the session facility provided by Rails, which you can think of as being like an instance of the cookies variable from Section 8.2.1 that automatically expires upon browser close. (Indeed, as noted in Section 8.5, session is implemented in just this way.) We also use the request object to get the fullpath, i.e., the full path (URI) of the requested page. The store_location method puts the requested URI in the session variable under the key :return_to.

       To make use of store_location, we need to add it to the signed_in_user before filter, as shown in Listing 9.19.

 

 

 

 
 
 
image
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)