
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
A simple sitemesh-like rack filter for Rails apps
This gem lets you specify a url to a place to fetch the layout for your application using a method in you controllers.
In your Gemfile
gem 'simple_decorator'
Create a decorator lets say at 'http://www.mysite.com/decorator' containing your site's layout:
<html>
<head>
<title>$title - SiteName</title>
$head
</head>
<body>
<div class="somestyling">
$body
</div>
</body>
</html>
In your layout file (typically application.html.erb)
<html>
<head>
<title>My apps page</title>
<link rel="stylesheet" href="my_app_styles.css" type="text/css" media="screen" />
</head>
<body>
<h1>My apps dynamic response</h1>
</body>
</html>
In any controller
# usually you put this in your ApplicationController
# but feel free to override in any other controller
def decorator_url
"http://www.mysite.com/decorator"
end
The response will now have the layout of your decorator, but display dynamic contents from your app, including your stylesheets and javacripts
<html>
<head>
<title>My apps page - SiteName</title>
<link rel="stylesheet" href="my_app_styles.css" type="text/css" media="screen" />
</head>
<body>
<div class="somestyling">
<h1>My apps dynamic response</h1>
</div>
</body>
</html>
FAQs
Unknown package
We found that simple_decorator 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.