
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
= Ekuseru
Ekuseru is a gem to generate Microsoft Excel documents with Rails. This gem provides templating abilities to create excel documents.
== Installation
=== Rails 3
Edit your Gemfile, add:
gem "ekuseru"
then run
bundle install
=== Rails 2
Ekuseru master branch now support rails 3 and is NOT backward compatible. To use ekuseru in rails 2, install it as plugin :
== Usage
=== Controller
To generate xls document, add respond_to :xls
to your controller.
Example:
class ProductsController < ApplicationController respond_to :html, :xls
def index
@products = Product.all
respond_with @products
end
...
end
=== Template
Ekuseru will use .eku files as the template. So, with the example above, we will need to create 'index.xls.eku' in app/views/products/. Basically it's just an ordinary ruby file.
In the template, we will get a xls
variable which is a
Spreadsheet::Workbook object ready to be modified like whatever we want.
Consult the Spreadsheet documentation to create the template.
http://spreadsheet.rubyforge.org/GUIDE_txt.html
You can set the filename sent to the user with __filename
variable.
In the template :
__filename = "Products Catalog.xls"
sheet1 = xls.create_worksheet
sheet1[0, 0] = "Products Catalog"
sheet1.row(1).concat ["Name", "Price", "Stock", "Description"]
@products.each_with_index do |p, i| sheet1.update_row i+2, p.name, p.price, p.stock, p.description end
title_format = Spreadsheet::Format.new(:color => :blue, :weight => :bold, :size => 18) sheet1.row(0).set_format(0, title_format)
bold = Spreadsheet::Format.new(:weight => :bold) sheet1.row(1).default_format = bold
That's it. Then you can create a link to the xls file if you want, like:
<%= link_to 'Download as Excel', products_path(:format => :xls) %>
== Credits
FAQs
Unknown package
We found that ekuseru demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.