Don't use instace variables in component views
Just like we do every else (sometimes even on that very same file), we use the method instead of the instance variable. We're doing this change now because we're about to modify one of these files (the poll question answers documents index component).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<%= back_link_to admin_question_path(@answer.question) %>
|
||||
<%= back_link_to admin_question_path(answer.question) %>
|
||||
|
||||
<h2><%= t("admin.questions.show.answers.documents_list") %></h2>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</ul>
|
||||
|
||||
<div class="poll-question-form">
|
||||
<% if can?(:update, @answer) %>
|
||||
<% if can?(:update, answer) %>
|
||||
<%= form_for(Poll::Question::Answer.new, url: admin_answer_documents_path(answer)) do |f| %>
|
||||
<%= render "shared/errors", resource: answer %>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%= header do %>
|
||||
<%= render Admin::ActionComponent.new(
|
||||
:destroy,
|
||||
@page,
|
||||
page,
|
||||
text: t("admin.site_customization.pages.index.delete"),
|
||||
confirm: true,
|
||||
class: "delete"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @tenants.each do |tenant| %>
|
||||
<% tenants.each do |tenant| %>
|
||||
<%= render Admin::Tenants::RowComponent.new(tenant) %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<h1><%= t("sdg.goals.help.title") %></h1>
|
||||
<p><%= t("sdg.goals.help.description") %></p>
|
||||
<ul class="tabs" id="help_tabs" data-deep-link="true" data-tabs>
|
||||
<% @goals.each do |goal| %>
|
||||
<% goals.each do |goal| %>
|
||||
<li class="tabs-title <%= is_active?(goal) %>">
|
||||
<%= link_to "#goal_#{goal.code}_tab" do %>
|
||||
<% render SDG::Goals::IconComponent.new(goal) %>
|
||||
@@ -18,7 +18,7 @@
|
||||
</ul>
|
||||
|
||||
<div class="tabs-content" data-tabs-content="help_tabs">
|
||||
<% @goals.each do |goal| %>
|
||||
<% goals.each do |goal| %>
|
||||
<div id="goal_<%= goal.code %>_tab" class="tabs-panel <%= is_active?(goal) %>">
|
||||
<h2><%= goal.code_and_title %></h2>
|
||||
<p><%= sanitize t("sdg.goals.goal_#{goal.code}.description") %></p>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ul class="tabs" id="goal_<%= goal.code %>_targets" data-deep-link="true" data-tabs>
|
||||
<% [global_targets, local_targets].each do |targets| %>
|
||||
<li class="tabs-title <%= active(targets) %>">
|
||||
<%= link_to title(targets), "#goal_#{@goal.code}_tab_#{type(targets)}_targets" %>
|
||||
<%= link_to title(targets), "#goal_#{goal.code}_tab_#{type(targets)}_targets" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @records.each do |record| %>
|
||||
<% records.each do |record| %>
|
||||
<tr>
|
||||
<td><%= record.title %></td>
|
||||
<td><%= record.sdg_goal_list %></td>
|
||||
|
||||
Reference in New Issue
Block a user