Niggling issue on our scss file:
background-image: url("file://<%= Rails.application.assets.find_asset('company_logo_for_forms.png').pathname %>");
It'd be nice to implement a helper method on sass-rails to encapsulate that logic. Something like
Module Sass
Module Rails
Module Helpers
def asset_full_path(asset_name)
Rails.application.assets.find_asset(asset_name).try(:pathname) || ""
end
end
end
end
Another issue, because we are sharing our html and pdf template, we had to do this:
<% if params[:format] && params[:format] == 'pdf' %>
<%= wicked_pdf_stylesheet_link_tag "invoice_pdf" %>
<%= wicked_pdf_javascript_include_tag "invoice" %>
<% else %>
<%= javascript_include_tag "invoice" %>
<%= stylesheet_link_tag "invoice" %>
<% end %>
Useful Links