Extract link text to a helper
This way we can use the same code in custom views which won't use the same text.
This commit is contained in:
@@ -6,4 +6,8 @@ module LegislationHelper
|
||||
def format_date_for_calendar_form(date)
|
||||
l(date, format: "%d/%m/%Y") if date
|
||||
end
|
||||
|
||||
def new_legislation_proposal_link_text(process)
|
||||
t("proposals.index.start_proposal")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,10 @@
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<% if @process.proposals_phase.open? %>
|
||||
<p><%= link_to t("proposals.index.start_proposal"), new_legislation_process_proposal_path(@process), class: 'button expanded' %></p>
|
||||
<p><%= link_to new_legislation_proposal_link_text(@process),
|
||||
new_legislation_process_proposal_path(@process),
|
||||
class: 'button expanded',
|
||||
id: 'create-new-proposal' %></p>
|
||||
<% end %>
|
||||
<%= render 'legislation/proposals/categories', taggable: @process %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user