Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
intersect_rails_layout
Advanced tools
h1. !http://railsapps.github.io/images/rails-36x36.jpg(RailsLayout Gem)! RailsLayout Gem
RailsLayout is a utility gem to use during development.
It is a Rails generator that you add to your Rails application Gemfile.
Use it to set up a front-end framework:
It will rename application.css.css to application.css.scss.
And modify the necessary asset files:
and add either:
or:
It will set up a default application layout.
You also get partials for
h4. Supported Frameworks
You can generate layout files suitable for use with the following front-end frameworks:
h4. Generated Files
The RailsLayout gem generates application layout files:
Additionally, when the @simple@ option is selected:
h4. Support for ERB or Haml
If you are using ERB for Rails views, the RailsLayout gem will generate ERB files.
If you are using Haml, the RailsLayout gem will generate Haml files instead.
h4. Rails Composer
The "Rails Composer":http://railsapps.github.io/rails-composer/ tool, an application template used to create starter applications, uses the RailsLayout gem to generate the layout files used in various starter applications. You can use Rails Composer to generate entire applications.
h2. Usage Example
To see how the generated files from the RailsLayout gem are used, see the "Learn Rails":https://github.com/RailsApps/learn-rails example application that is described in the book "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html.
!http://railsapps.github.io/images/learn-rails-cover-130x161.jpg(Learn Ruby on Rails)!:http://learn-rails.com/learn-ruby-on-rails.html
h2. Installing a Front-End Framework
Instead of following the "instructions for Twitter Bootstrap":http://railsapps.github.io/twitter-bootstrap-rails.html or "Zurb Foundation":http://foundation.zurb.com/docs/rails.html to install a front-end framework, add the gems you need. Then use the RailsLayout gem. It will set up your assets files.
h3. Install Gems for a Front-End Framework
Add the gems you need to your Rails application Gemfile:
h4. Twitter Bootstrap 2.3
gem 'bootstrap-sass', '~> 2.3.2.2'
h4. Twitter Bootstrap 3.0
gem 'bootstrap-sass'
h4. Zurb Foundation 4.0
gem 'compass-rails', '~> 2.0.alpha.0' gem 'zurb-foundation'
Use Bundler to install the gems:
$ bundle install
h2. Install the RailsLayout Gem
Add it to your Rails application Gemfile:
group :development do gem 'rails_layout' end
You don't need the gem deployed to production, so put it in the @development@ group.
If you want to use a newer unreleased version from GitHub:
group :development do gem 'rails_layout', github: 'RailsApps/rails_layout' end
Use Bundler to install the gem:
$ bundle install
h2. Generate a Simple Layout
To create a set of simple layout files:
$ rails generate layout simple
Use @--force@ if you want to overwrite existing files:
$ rails generate layout simple --force
See the files that are generated:
The RailsLayout gem will create the file:
h2. Twitter Bootstrap 2.3 Layout
To create layout files for use with Twitter Bootstrap 2.3:
$ rails generate layout bootstrap2
Use @--force@ if you want to overwrite existing files:
$ rails generate layout bootstrap2 --force
See the files that are generated:
The RailsLayout gem will create the file:
and modify the file:
h2. Twitter Bootstrap 3.0 Layout
To create layout files for use with Twitter Bootstrap 3.0:
$ rails generate layout bootstrap3
Use @--force@ if you want to overwrite existing files:
$ rails generate layout bootstrap3 --force
See the files that are generated:
The RailsLayout gem will create the file:
and modify the file:
h2. Zurb Foundation 4.0 Layout
To create layout files for use with Zurb Foundation 4.0:
$ rails generate layout foundation4
Use @--force@ if you want to overwrite existing files:
$ rails generate layout foundation4 --force
See the files that are generated:
The RailsLayout gem will create the file:
and modify the file:
h2. Reverting to None
To revert your application to a default application layout:
$ rails generate layout none
The RailsLayout gem will remove files it may have added:
Additionally, it will restore these files to the default versions:
The file app/assets/stylesheets/application.css.scss will contain a CSS rule but you can ignore it or remove it.
h2. Help
To see help messages:
$ rails generate layout --help
h2. Issues
Any issues? Please create an "issue":http://github.com/RailsApps/rails_layout/issues on GitHub. Reporting issues (and patching!) helps everyone.
h2. Credits
Daniel Kehoe maintains this gem as part of the "RailsApps project":http://railsapps.github.io/.
Please see the "CHANGELOG":https://github.com/RailsApps/rails_layout/blob/master/CHANGELOG.textile for a list of contributors.
Is the gem useful to you? Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps. I'd love to know you were helped out by the gem.
h2. MIT License
"MIT License":http://www.opensource.org/licenses/mit-license
Copyright © 2013 Daniel Kehoe
FAQs
Unknown package
We found that intersect_rails_layout 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.