sparklines_controller.rb
来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RB 代码 · 共 31 行
RB
31 行
# Handles requests for sparkline graphs.## You shouldn't need to edit or extend this, but you can read# the documentation for SparklinesHelper to see how to call it from# another view.## AUTHOR# # Geoffrey Grosenbach[mailto:boss@topfunky.com]## http://topfunky.com#class SparklinesController < ApplicationController layout nil def index # Make array from comma-delimited list of data values ary = [] params['results'].split(',').each do |s| ary << s.to_i end send_data( Sparklines.plot( ary, params ), :disposition => 'inline', :type => 'image/png', :filename => "spark_#{params[:type]}.png" ) endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?