![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Caracal is a ruby library for dynamically creating professional-quality Microsoft Word documents.
Caracal-Rails is a drop in solution for registering the Microsoft Word mime type and for establishing a template handler in Rails for the :docx format. All caracal documents are rendered with an explicit block passing a reference to the Caracal::Document object named docx
.
Please see the caracal-example repository for a working demonstration of the library's capabilities.
Add this line to your application's Gemfile:
gem 'caracal-rails'
Then execute:
$ bundle install
Design your controller normally and respond to the docx
format:
class ReportsController < ApplicationController
def show
# collect your models/view models here
respond_to do |format|
format.docx { headers["Content-Disposition"] = "attachment; filename=\"caracal.docx\"" }
end
end
end
Then add a view file with the Caracal extension:
apps/views/reports/show.docx.caracal
Specify the format docx
in your route:
resources :reports, only: [:show], format: 'docx'
Inside your view, simply issue Caracal commands on the document object:
docx.font 'Droid Serif'
docx.style 'special' do
font 'Droid Serif'
italic true
size 16
end
docx.h1 'Quarterly Report'
docx.hr
@report.clients.each do |client|
docx.h2 client.name
docx.p 'Lorem ipsum dolor...'
docx.p do
text 'This is a sentence with a '
link 'link', 'http://www.google.com/', style: 'special'
text ' in the middle.'
end
docx.img image_url('https://www.example.com/logo.png'), width: 300, height: 200, align: 'right'
docx.br
docx.table client.tablular_data, border_size: 4 do
cell_style rows[0], background_color: '3366cc', color: 'ffffff', bold: true
end
docx.page
docx.p 'This is an bulleted list.'
docx.ul do
li do
strong 'Item 1'
text 'More text'
end
li 'Item 2'
end
end
See the Caracal library for more details.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Because my son likes caracals. :)
A tip of the hat to the wonderful PDF generation libraries Prawn and Prawnto.
Copyright (c) 2014 Trade Informatics, Inc
FAQs
Unknown package
We found that caracal-rails 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.