
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Sometimes being able to preview a view might come in handy, like when a view is going to be used only inside a PDF, for example.
This gem allows a setup similar ActionMailer::Preview
, and provides a development tool for rendering and debugging views that wouldn't otherwise be rendered in your application.
Add this line to your application's Gemfile:
gem 'action_view_preview'
And then execute:
$ bundle
Or install it yourself as:
$ gem install action_view_preview
Run rails generate action_view_preview:install
and the generator should create a hello_preview.rb
and mount the route in your routes.rb
file, similar to the steps shown below in the manual install.
routes.rb
:Rails.application.routes.draw do
# Add the line below
mount ActionViewPreview::Engine => "/action_view_preview"
end
*_preview.rb
on test/views/previews/
, e.g. hello_preview.rb
:class HelloViewPreview < ActionViewPreview::Base
def hello
'<b>Hello world</b>'
end
end
/action_view_preview
to see the available previewsAdd a ActionViewPreview.setup
block to an initializer. For example, if you want to place the preview files in lib/view_previews
:
ActionViewPreview.setup do |config|
config.preview_path = "#{Rails.root}/lib/view_previews"
end
Possible config values:
Config | Default | Description |
---|---|---|
preview_path | test/views/previews | Path to the preview files |
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that action_view_preview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.