-3

I would like to show the data that has been passed by the hidden fields on a page. For example, I put a hidden field on page1 and then sends it on page2 then I added another value hidden field. I want to see all hidden data on page3. thank you

page1

<%= form_tag( prenotazione_path, method: "post") do %>
 <%= hidden_field_tag "titolo", params[:titolo] %>
<%= submit_tag "PRENOTA" %>
<% end %>

page2

<p>
  <strong>Titolo:</strong>
   ......???
</p>
Eric
  • 1
  • 2

1 Answers1

0

That is possible. Please see this code,

page1

<%= form_tag( page2_path, method: "post") do %>
 <%= hidden_field_tag "value1", "value1" %>
<%= submit_tag "PRENOTA" %>
<% end %>

page2

<%= form_tag( page3_path, method: "post") do %>
 <%= hidden_field_tag "value1", params[:value1] %>
 <%= hidden_field_tag "value2", "value2 %>
<%= submit_tag "PRENOTA" %>
<% end %>

Page3

<p>
  <strong>Values:</strong>
   <%= params[:value1] %>
   <%= params[:value2] %>
</p>

I don't know why you need this approach. Use sessions instead.

Thaha kp
  • 3,573
  • 1
  • 22
  • 25