How do I change or remove layouts from my application in a specific Rails view so that my users have a more pleasant printing experience? (No navigation bar or other additional data)
I have been banging my head on the table for several hours, trying to figure it out. I tried using render layout: false without success.
I tried to create such an action as shown below, but for me this did not work:
def print respond_to do |format| format.html { render layout: false } end end
I tried to link this action using the following:
<%= link_to 'Printer Friendly Version', product_path(@product), :action => 'print', target: '_new' %>
Am I just here? How can I better approach this obstacle? I don't want to use PDF or Javascript, I just want to display HTML compatible with the printer.
html css ruby-on-rails printing
pyRabbit
source share