I have the following code in messages.html.erb.
<% vars = request.query_parameters
@templates = session[:templates]
%>
<h3>There are <%= @templates.count %> templates</h3>
<form method='post' action='http://localhost:80/text.php'>
<select name="template">
<% @templates.each do |t| %>
<option name='<%=t.name %>'><%= t.name %></option>
<% end %>
</select>
<br /><br />
<input type='submit' value='Submit' />
</form>
Now, in application_helper.rb, there is a method link_to_phone wherein we have:
session[:templates] = Template.all
link_to(h(phone), message_path(phone: phone, id: contact.id, page: 'contacts'), title: phone)
where message_path takes us to messages.html.erb.
If the section( where I have omitted the phone, id, and page fields as they do not play a part here) :
<select name="template">
<% @templates.each do |t| %>
<option name='<%=t.name %>'><%= t.name %></option>
<% end %>
is omitted from messages.html.erb, I get the statement that in my case there are 3 templates stored in the session by the link_to_phone definition. If that section is included in the code then I get a Cookie Overflow. I'm not using cookies to my knowledge, but instead thought I was using the session. I have another statement very similar to this in my view/template/index.html.erb wherein I loop through the @templates and show the name, msg, and subject, using this exact same idea except putting the separate template name, msg, and subject into a table with no problem.
What am I missing here that is causing this 'Cookie' problem?