Created
March 5, 2018 11:34
-
-
Save salami-art/7ce6685159f06f0bc55168df6dc66e1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :footer_scripts do %> | |
<script type="text/javascript"> | |
<% if @current_province.present? %> | |
$('#provinces').val('<%= @current_province.name.titleize %>'); | |
<% end %> | |
<% if @current_speciality.present? %> | |
$('#specialities').val('<%= @current_speciality.profession.capitalize %>'); | |
<% end %> | |
</script> | |
<% cache 'docdropdown_data' do %> | |
<script type="text/javascript"> | |
application.setData('suggestions_for', { | |
'provinces' : <%= @most_clicked_cities.to_json.html_safe %>, | |
'specialities' : <%= @most_clicked_specialities.to_json.html_safe %> | |
}); | |
application.setData('options_for', { | |
'provinces' : {<%= @other_provinces.collect { |province| "\"#{province.name}\" : { id : \"#{province.region.slug}/#{province.name.downcase}\"}" }.join(", ").html_safe %>}, | |
'specialities' : {<%= @specialities.collect { |speciality| "\"#{speciality.profession.capitalize}\" : { id : \"#{speciality.slug}\"}" }.join(", ").html_safe %>} | |
}); | |
</script> | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment