move convert.rb to helper file

parent a26da0ac
Pipeline #875 canceled with stages
in 0 seconds
......@@ -55,20 +55,11 @@
text-decoration: none;
color: gray;
}
.industry::after {
.industry::after, .location::after {
margin: 5px;
content: "|";
color: black;
}
.industry:nth-last-child(1)::after {
content: "";
}
.location::after {
margin: 5px;
content: "|";
color: black;
}
.location:last-child::after {
.industry:last-child::after, .location:last-child::after {
content: "";
}
module Convert
def self.to_convert(str)
def to_convert(str)
str.mb_chars.normalize(:kd).gsub(/[Đđ]/, 'd').gsub(/[^\x00-\x7F]/,'').gsub(/[\W+]/,' ').downcase.to_s.split(' ').join('-')
end
end
......@@ -8,9 +8,11 @@
</div>
<div class="breadcrumb">
<%= link_to "TOP", root_path %>&ensp;/&ensp;
<% @job_details.cities.each do |city| %>
<%= link_to city.name, city_jobs_path(converted_name: city.converted_name) , class: 'location' %>
<% end %>&ensp;/&ensp;
<div>
<% @job_details.cities.each do |city| %>
<%= link_to city.name, city_jobs_path(converted_name: city.converted_name) , class: 'location' %>
<% end %>&ensp;/&ensp;
</div>
<% @job_details.industries.each do |industry| %>
<%= link_to industry.name, industry_jobs_path(converted_name: industry.converted_name), class: 'industry' %>
<% end %>&ensp;/&ensp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment