CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 19:44:23 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"c9e4b24e163a50727b79bb5c8a62ea3b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=veBodqBwuyQzfQX57hN5SKFcGBjHTGiT%2BqrCtJBCW7HsUjl%2Fa3AxI6RqZUVP4%2ByTqqwMf7TjnaEzWCiULeAmHFPoex7YWKLvUcV3JY3ccaQZu%2BXaF%2By0LtEcE%2FdFuRxjicio8K7hvrZljd06dABM6e1HeG02gG8q%2BR%2FPYZa8uhQBeeLvH%2BtZ9lv5FYsusjqpfaF77ObOpO13so9OHP5FzxpuxpFD%2FrEO%2B1%2FnMBMMYqTFjgqzbsuO1biI6ItOi9J6Qa3guqheB55vbUAyqtOtOA%3D%3D--fkPVkVt%2FFlQDnqYz--BuUV8u4DiWYyNfZpnHba4g%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.152364179.1753904663; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 19:44:23 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 19:44:23 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: AC00:1BAD60:70188:8FBBA:688A7617
GitHub - asanghi/excel_rails: rxls views for Rails 3
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 8
rxls views for Rails 3
License
asanghi/excel_rails
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
excel_rails ================= A Rails plugin to generate xls documents by using rxls templates. Based on Defv's railsxls plugin (https://github.com/DefV/railsxls) without the Java part. Also inspired heavily from prawn_rails gem (https://github.com/Volundr/prawn-rails). The gem has a new cool feature which lets you pick a hand-crafted excel file as a template in your view. Pass the path to your excel template using the :template_path option and instead of creating a blank spreadsheet for you to fill, your excel file will be parsed and yielded for you to fill in the blank. Thanks to Stepan Filatov @ https://github.com/sfilatov Installation ============ Note that this gem works only with Rails 3 Put the following line in your Gemfile gem 'excel_rails' Run 'bundle install' Name your views as action.xls.rxls (See below for usage) Make a request to your application with .xls extension to respond to excel. Dependencies ============ ruby-ole spreadsheet iconv Example ======= Example spreadsheet usage as found here: https://github.com/jacobat/ruby-spreadsheet -- in the view "index.xls.rxls" excel_document(:filename => "all_lines.xls") do |workbook| sheet = workbook.create_worksheet sheet.name = "What's in a name" sheet.row(0).concat %w{Name Country Acknowlegement} sheet[1,0] = 'Japan' row = sheet.row(1) row.push 'Creator of Ruby' row.unshift 'Yukihiro Matsumoto' sheet.row(2).replace [ 'Daniel J. Berger', 'U.S.A.', 'Author of original code for Spreadsheet::Excel' ] sheet.row(3).push 'Charles Lowe', 'Author of the ruby-ole Library' sheet.row(3).insert 1, 'Unknown' sheet.update_row 4, 'Hannes Wyss', 'Switzerland', 'Author' sheet.row(0).height = 18 format = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 18 sheet.row(0).default_format = format bold = Spreadsheet::Format.new :weight => :bold 4.times do |x| sheet.row(x + 1).set_format(0, bold) end end In the above file excel_document yields a new Spreadsheet:Workbook object to the block. If you provide a :filename option to the excel_document method, a filename will be provided to the downloaded file. If your browser supports it you can inline the excel document as well. If you provide :template_path - path to existed xls file, workbook will be loaded from the file. excel_document(:filename => "report.xls", :template_path => "/tmp/report_template.xls") do |workbook| sheet = workbook.worksheet 0 ... # any staff form previous example end If you provide a :renderer option to the excel_document method, you can use your customized Spreadsheet::Workbook to create a new excel file. Your view "index.xls.rxls" file could look like this: excel_document(:filename => "foobar.xls", :renderer => Spreadsheet::CustomWorkbook) do |workbook| workbook.new_worksheet("#{t_model(Product)}") end And the renderer class ("lib/spreadsheet"): module Spreadsheet class CustomWorkbook < Spreadsheet::Workbook attr_accessor :sheet def new_worksheet @sheet = workbook.create_worksheet @sheet.name = "What's in a name" end end end -- in the controller def index @lines = Line.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @lines } format.xls end end Copyright (c) 2010 Aditya Sanghi, released under the MIT license
About
rxls views for Rails 3
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
You can’t perform that action at this time.