move convert.rb to helper file

parent a26da0ac
Pipeline #875 canceled with stages
in 0 seconds
...@@ -55,20 +55,11 @@ ...@@ -55,20 +55,11 @@
text-decoration: none; text-decoration: none;
color: gray; color: gray;
} }
.industry::after { .industry::after, .location::after {
margin: 5px; margin: 5px;
content: "|"; content: "|";
color: black; color: black;
} }
.industry:nth-last-child(1)::after { .industry:last-child::after, .location:last-child::after {
content: "";
}
.location::after {
margin: 5px;
content: "|";
color: black;
}
.location:last-child::after {
content: ""; content: "";
} }
module Convert 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('-') str.mb_chars.normalize(:kd).gsub(/[Đđ]/, 'd').gsub(/[^\x00-\x7F]/,'').gsub(/[\W+]/,' ').downcase.to_s.split(' ').join('-')
end end
end end
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
</div> </div>
<div class="breadcrumb"> <div class="breadcrumb">
<%= link_to "TOP", root_path %>&ensp;/&ensp; <%= link_to "TOP", root_path %>&ensp;/&ensp;
<% @job_details.cities.each do |city| %> <div>
<%= link_to city.name, city_jobs_path(converted_name: city.converted_name) , class: 'location' %> <% @job_details.cities.each do |city| %>
<% end %>&ensp;/&ensp; <%= link_to city.name, city_jobs_path(converted_name: city.converted_name) , class: 'location' %>
<% end %>&ensp;/&ensp;
</div>
<% @job_details.industries.each do |industry| %> <% @job_details.industries.each do |industry| %>
<%= link_to industry.name, industry_jobs_path(converted_name: industry.converted_name), class: 'industry' %> <%= link_to industry.name, industry_jobs_path(converted_name: industry.converted_name), class: 'industry' %>
<% end %>&ensp;/&ensp; <% 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