Help with page redirect

P

Peter Heywood

Today I learned how to write and read cookies in eruby but I'm looking
for a better way "ruby way" of doing something.

I read to see if the user has my cookie. If they have read the page
already and allowed a cookie I want to send them automatically to
another page.

This is what I have:

<% if cookie == 'true' %>
<meta http-equiv="refresh" content="0; URL=/page/index" />
<%else%>
I put in my content
<%end%>

Surely there is a better ruby way than using a meta tag?

Thanks in advance,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top