<% if thoughts.count >= 1 %> <% thoughts.each_with_index do |thought, index| %>
">

You said that you thought...

<%= thought.content %>
<% if thought.pattern_title %>

...and that this relates to this harmful thought pattern: <%= thought.pattern_title %>

<%= thought.pattern_description %>
<% else %>

...and did not choose a related thought pattern.

<% end %> <%= content_tag(:button, t(:next), type: "button", class: "next-page btn btn-primary pull-right") %>
<%= form_for thought, url: update_path, html: { class: "multi-form not-displayed", id: index}, remote: true do |f| %>

Thought <%= index + 1 %> of <%= thoughts.count %>

Come up with a challenging thought for your thought...
<%= thought.content %>
<% if thought.pattern_recommendations %>

For the harmful thought <%= thought.pattern_title %> the following might be useful:

<%= thought.pattern_recommendations.try(:html_safe) %>

<% end %> <%= f.label :challenging_thought, "Now you try it. Write a challenging thought below:", for: "challenge#{index}" %> <%= f.text_area :challenging_thought, id: "challenge#{index}", class: "form-control", required: true, rows: 3 %> <%= f.hidden_field :id %> <%= content_tag(:button, t(:next), type: "submit", class: "challenging btn btn-primary pull-right") %> <% end %>

Because what you THINK, FEEL, Do are related, a challenging thought can change how you act.

<%= image_tag("changing_actions.gif", width: "100%") %>

After you come up with a challenging thought, you can also come up with an "As If" action which means what you would do based on the challenging thought you came up with.

<%= content_tag(:button, t(:next), type: "button", class: "next-page btn btn-primary pull-right") %>
<%= form_for thought, url: update_path, html: { class: "multi-form not-displayed" }, onsubmit: "validatePublic(event,'thought_shared_item_true')", remote: true do |f| %>

You thought...

<%= thought.content %>

A challenging thought was...

<%= f.label :act_as_if, "What could you do to ACT AS IF you believe this?" %> <%= f.text_area :act_as_if, class: "form-control", required: true, rows: 3 %>
<%= f.hidden_field :id %> <% if current_participant.active_group.arm.social? %> <% end %> <%= content_tag(:button, t(:next), type: "submit", class: "btn btn-primary pull-right") %> <% end %> <% end %> <% else %>

Please return to section 1 of "Think" to input more thoughts for reflection

<% end %>