Ruby On Rails Classroom image

Neha  Jaggi / 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
Neha  Jaggi

Skills    Ruby On Rails

Qualifications :- High School - , College/University - Graphic Era Hill University, Dehradun, College/University - ,
Location :-Dehradun,Dehradun,UTTARAKHAND,India
Description:-

Experienced Software Developer with a demonstrated history of working in the Information Technology and services industry. Skilled in Web Technologies (Ruby on Rails, PostgreSQL, php, Laravel and AJAX). 


Explore
 

  Students (0)