Skip to content

Commit bca89d2

Browse files
committed
Moving the state and county from ruby model to the erb themselves
1 parent aa7773a commit bca89d2

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

app/views/screener_mailer/send_screener_results.html.erb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
<h3 style="font-weight: bold;">
2727
<%= t('views.screener_mailer.send_screener_results.how_to_submit_heading') %>
2828
</h3>
29-
<% website = LocationData::Counties.website_for(@state, @county) %>
30-
<% email = LocationData::Counties.email_for(@state, @county) %>
29+
<% state = @screener.state %>
30+
<% county = @screener.county %>
31+
<% website = LocationData::Counties.website_for(state, county) %>
32+
<% email = LocationData::Counties.email_for(state, county) %>
3133

3234
<ol style="line-height: 2;">
3335
<li>
@@ -39,7 +41,7 @@
3941
<strong><%= t('views.screener_mailer.send_screener_results.mail_label') %></strong> <%= t('views.screener_mailer.send_screener_results.mail_instructions') %>
4042
<br/><br/>
4143
<div style="font-style: italic;">
42-
<% LocationData::Counties.mailing_address_for(@state, @county).split("\n").map do |line| %>
44+
<% LocationData::Counties.mailing_address_for(state, county).split("\n").map do |line| %>
4345
<%= line %>
4446
<br/>
4547
<% end %>
@@ -49,7 +51,7 @@
4951
<strong><%= t('views.screener_mailer.send_screener_results.in_person_label') %></strong> <%= t('views.screener_mailer.send_screener_results.in_person_instructions') %>
5052
<br/><br/>
5153
<div style="font-style: italic;">
52-
<% LocationData::Counties.physical_address_for(@state, @county).split("\n").map do |line| %>
54+
<% LocationData::Counties.physical_address_for(state, county).split("\n").map do |line| %>
5355
<%= line %>
5456
<br/>
5557
<% end %>
@@ -68,7 +70,7 @@
6870
<%= t('views.screener_mailer.send_screener_results.email_office', email: email) %>
6971
</li>
7072
<% end %>
71-
<% if (phone = LocationData::Counties.phone_for(@state, @county)).present? %>
73+
<% if (phone = LocationData::Counties.phone_for(state, county)).present? %>
7274
<li><%= t('views.screener_mailer.send_screener_results.call_office', phone: phone) %></li>
7375
<% end %>
7476
</ul>

app/views/screener_mailer/send_screener_results.text.erb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
<%= t('views.screener_mailer.send_screener_results.reference_code', code: @screener.confirmation_code) %>
1212

1313
---
14-
<% website = LocationData::Counties.website_for(@state, @county) %>
15-
<% email = LocationData::Counties.email_for(@state, @county) %>
14+
<% state = @screener.state %>
15+
<% county = @screener.county %>
16+
<% website = LocationData::Counties.website_for(state, county) %>
17+
<% email = LocationData::Counties.email_for(state, county) %>
1618

1719
<%= t('views.screener_mailer.send_screener_results.how_to_submit_heading') %>
1820

@@ -22,18 +24,18 @@
2224

2325
2. <%= t('views.screener_mailer.send_screener_results.mail_label') %> <%= t('views.screener_mailer.send_screener_results.mail_instructions') %>
2426

25-
<%= LocationData::Counties.mailing_address_for(@state, @county).split("\n").join("\n ") %>
27+
<%= LocationData::Counties.mailing_address_for(state, county).split("\n").join("\n ") %>
2628

2729
3. <%= t('views.screener_mailer.send_screener_results.in_person_label') %> <%= t('views.screener_mailer.send_screener_results.in_person_instructions') %>
2830

29-
<%= LocationData::Counties.physical_address_for(@state, @county).split("\n").join("\n ") %>
31+
<%= LocationData::Counties.physical_address_for(state, county).split("\n").join("\n ") %>
3032

3133
<%= t('views.screener_mailer.send_screener_results.questions_intro') %>
3234

3335
- <%= t('views.screener_mailer.send_screener_results.check_website', website: website) %>
3436
<% if email.present? %>
3537
- <%= t('views.screener_mailer.send_screener_results.email_office', email: email) %>
3638
<% end %>
37-
<% if (phone = LocationData::Counties.phone_for(@state, @county)).present? %>
39+
<% if (phone = LocationData::Counties.phone_for(state, county)).present? %>
3840
- <%= t('views.screener_mailer.send_screener_results.call_office', phone: phone) %>
3941
<% end %>

0 commit comments

Comments
 (0)