Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

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

To implement the forwarding itself, we use the redirect_back_or method to redirect to the requested URI if it exists, or some default URI otherwise, which we add to the Sessions controller create action to redirect after successful signin (Listing 9.20). The redirect_back_or method uses the or operator || through

session [:return to] ||  default

 

This evaluates to session[:return_to] unless it’s nil, in which case it evaluates to the given default URI. Note that Listing 9.18 is careful to remove the forwarding URI; otherwise, subsequent signin attempts would forward to the protected page until the user closed his browser. (Testing for this is left as an exercise [Section 9.6.])  

With that, the friendly forwarding integration test in Listing 9.17 should pass, and the basic user authentication and page protection implementation is complete. As usual, it’s a good idea to verify that the test suite is green before proceeding:

$ bundle exec rspec spec/
 
 
 
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)