下面這個樣子QRCodes的missunderstanding任何建議是在docs列出的例子。你可以試試這個例子,看看是否能工程?如果沒有,那麼你很可能有一些額外的CSS elsewher E在您的應用程序,它是獲得混合。
控制器
require 'rqrcode'
def qrcode
@qr = RQRCode::QRCode.new('hello world')
end
查看
<style type="text/css">
table {
border-width: 0;
border-style: none;
border-color: #0000ff;
border-collapse: collapse;
}
td {
border-width: 0;
border-style: none;
border-color: #0000ff;
border-collapse: collapse;
padding: 0;
margin: 0;
width: 10px;
height: 10px;
}
td.black { background-color: #000; }
td.white { background-color: #fff; }
</style>
<table>
<% @qr.modules.each_index do |x| -%>
<tr>
<% @qr.modules.each_index do |y| -%>
<% if @qr.dark?(x,y) -%>
<td class="black"/>
<% else -%>
<td class="white"/>
<% end -%>
<% end -%>
</tr>
<% end -%>
</table>
呀!它確實....但是現在我將繼續使用Google搜索來顯示它稍小:D – shrek