Skip to content

Instantly share code, notes, and snippets.

View 3014zhangshuo's full-sized avatar
🎯
Coding

张硕 3014zhangshuo

🎯
Coding
View GitHub Profile
$('#myModal').append(function (event) {
$.ajax({
url: '<%= user_resume_save_html_path(@resume) %>',
type: 'post',
data: {
content: $('#cv').html()
},
success: function (result) {
$('#cv').html(result);
module AssetDataBase64Helper
def asset_data_base64(path)
asset = Rails.application.assets.find_asset(path)
throw "Could not find asset '#{path}'" if asset.nil?
base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "")
"data:#{asset.content_type};base64,#{Rack::Utils.escape(base64)}"
end
end
<head>
<meta charset='utf-8' />
- <%= wicked_pdf_stylesheet_link_tag "application" -%>
+ <%= stylesheet_link_tag (asset_data_base64('application.css')) %>
<%= csrf_meta_tags %>
<%#= wicked_pdf_stylesheet_link_tag "pdf" -%>
<%#= wicked_pdf_javascript_include_tag "number_pages" %>
<%#= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
- <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
font_dir = File.join(Dir.home, "fonts")
Dir.mkdir(font_dir) unless Dir.exists?(font_dir)
- Dir.glob(Rails.root.join("vendor", "fonts", "*")).each do |font|
+ Dir.glob(Rails.root.join("vendor","assets", "fonts", "*")).each do |font|
target = File.join(font_dir, File.basename(font))
File.symlink(font, target) unless File.exists?(target)
end
$('#qr-code').click(function (event) {
event.preventDefault();
$.ajax({
type: "GET",
dataType: "json",
url: "<%= user_resume_preview_path(@resume) %>",
success: function(data){}
});
});
<script type="text/javascript">
//图片1
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#img-1').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
def update_user_first_resume_name_resume
if current_user.present? && current_user.resumes.last.present?
resume = current_user.resumes.last
a = resume.resume_user_first_name
b = resume.resume_user_last_name
params[:name] = a += b
resume.name_resume = params[:name]
resume.save!
end
end
def update_user_first_resume_name_resume
if current_user.present? && current_user.resumes.last.present?
resume = current_user.resumes.last
a = resume.resume_user_first_name
b = resume.resume_user_last_name
params[:name] = a += b
resume.name_resume = params[:name]
resume.save!
end
end
def update_user_first_resume_name_resume
if current_user.present? && current_user.resumes.last.present?
resume = current_user.resumes.last
a = resume.resume_user_first_name
b = resume.resume_user_last_name
params[:name] = a += b
resume.name_resume = params[:name]
resume.save!
end
end
(function($) {
var element = $('#faq'),
originalY = element.offset().top;
// Space between element and top of screen (when scrolling)
var topMargin = 500;
// Should probably be set in CSS; but here just for emphasis
element.css('position', 'relative');