how to display the content of session[:intented_url] using rails 4 -


i want display page user logging in ...

a user has login before viewing pages. if not, user redirected login. @ point want display name of page want go , view once logged in.

in session controller, under create def - created following instant variable:

@intended_url = session::get('url.intended', url('/')); 

and view page contains following:

<h4>sign in go <%= @intended_url %>. 

unfortunately, nothing showing up?

if want store in session, must in controller has access it. means setting session takes place in controller page. by

session[:page_name = @intended_id

then can retrieve with

display ------> session[:page_name]

your problem can solved instead calling controller page.

controller.controller_action

this displays controllers action name if follow ruby on rails design page name.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -