A Rails plugin that adds spreadsheet template rendering using the caxlsx gem, enabling Excel generation within views.
Caxlsx Rails is a Ruby on Rails plugin that enables server-side generation of Excel spreadsheets using template files. It integrates the caxlsx gem into Rails' view layer, allowing developers to create `.xlsx.axlsx` templates that define spreadsheet structure and content, similar to how ERB templates work for HTML.
Rails developers who need to generate Excel reports, data exports, or downloadable spreadsheets from their applications.
It simplifies spreadsheet generation by leveraging Rails' familiar rendering system, keeping spreadsheet logic out of controllers and models, and providing a clean way to test and maintain Excel output.
A Rails plugin to provide templates for the axlsx gem
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses .xlsx.axlsx templates that integrate seamlessly with Rails' view layer, allowing spreadsheet logic to be separated from controllers and models, as shown in the template examples.
Supports standard Rails patterns like respond_to blocks and mailer attachments, with detailed examples for rendering spreadsheets in controllers and sending them via email.
Provides shared context and matchers for testing spreadsheet templates, enabling developers to verify content and structure in their specs, as outlined in the Testing section.
Offers configurable filenames, disposition (attachment/inline), and spreadsheet metadata like author and timestamp, giving fine-grained control over output.
Attaching spreadsheets in mailers requires verbose code with Base64 encoding and manual MIME type handling, as admitted in the Troubleshooting section with warnings about potential errors.
Rails version upgrades can introduce incompatibilities, such as the Rails 4.2 change that broke template path resolution, forcing syntax adjustments.
Inherits all limitations of the underlying caxlsx gem, so advanced Excel features or performance optimizations depend on caxlsx's development pace.
Testing spreadsheet templates requires custom RSpec shared contexts and matchers that aren't built-in, adding setup overhead compared to standard view testing.