style: link content
This commit is contained in:
@@ -109,7 +109,7 @@ class TicketsController < ApplicationController
|
||||
|
||||
# Try different approaches to load grover
|
||||
begin
|
||||
require 'bundler'
|
||||
require "bundler"
|
||||
Bundler.require(:default, Rails.env)
|
||||
Rails.logger.info "Bundler required gems successfully"
|
||||
rescue => bundler_error
|
||||
@@ -118,9 +118,9 @@ class TicketsController < ApplicationController
|
||||
|
||||
# Direct path approach using bundle show
|
||||
grover_gem_path = `bundle show grover`.strip
|
||||
grover_path = File.join(grover_gem_path, 'lib', 'grover')
|
||||
grover_path = File.join(grover_gem_path, "lib", "grover")
|
||||
|
||||
if File.exist?(grover_path + '.rb')
|
||||
if File.exist?(grover_path + ".rb")
|
||||
Rails.logger.info "Loading Grover from direct path: #{grover_path}"
|
||||
require grover_path
|
||||
else
|
||||
@@ -130,17 +130,17 @@ class TicketsController < ApplicationController
|
||||
|
||||
Rails.logger.info "Creating Grover instance with options"
|
||||
grover = Grover.new(html,
|
||||
format: 'A6',
|
||||
format: "A6",
|
||||
margin: {
|
||||
top: '10mm',
|
||||
bottom: '10mm',
|
||||
left: '10mm',
|
||||
right: '10mm'
|
||||
top: "10mm",
|
||||
bottom: "10mm",
|
||||
left: "10mm",
|
||||
right: "10mm"
|
||||
},
|
||||
prefer_css_page_size: true,
|
||||
emulate_media: 'print',
|
||||
emulate_media: "print",
|
||||
cache: false,
|
||||
launch_args: ['--no-sandbox', '--disable-setuid-sandbox'] # For better compatibility
|
||||
launch_args: [ "--no-sandbox", "--disable-setuid-sandbox" ] # For better compatibility
|
||||
)
|
||||
Rails.logger.info "Grover instance created successfully"
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@ class Ticket < ApplicationRecord
|
||||
|
||||
# Generate QR code as SVG
|
||||
def generate_qr_svg
|
||||
require 'rqrcode'
|
||||
require "rqrcode"
|
||||
qrcode = RQRCode::QRCode.new(to_qr_data)
|
||||
qrcode.as_svg(
|
||||
offset: 0,
|
||||
color: '000',
|
||||
shape_rendering: 'crispEdges',
|
||||
color: "000",
|
||||
shape_rendering: "crispEdges",
|
||||
module_size: 4,
|
||||
standalone: true
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user