Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
Created November 27, 2016 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbvf50mobile/00d2479b8c627d88b7a25e287bd41999 to your computer and use it in GitHub Desktop.
Save lbvf50mobile/00d2479b8c627d88b7a25e287bd41999 to your computer and use it in GitHub Desktop.
ef get_front_side (post_card)
@post_card = post_card
@msg = JSON.parse(@post_card.message)
@msg['front_side']['texts'].each do |text|
text['bg_color_rgba'] = 'rgba(255,255,255,'+(text['opacity'].to_f/100.0).to_s+')';
end
fonts_list = []
@msg['front_side']['texts'].each do |text|
fonts_list.push text['font_family']
end
@user_fonts = UserFont.where(:name => fonts_list).all
return render_to_string (
{
template: 'home/post_card_front',
layout: false
}
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment