
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Rails engine for brochure pages. Similar to High Voltage but with named routes.
Brochure pages are the semi-static pages like "home", "about us", "FAQ", "pricing", "contact us", etc.
Most of the designers I have worked with really appreciate the power and convenience this plugin provides. They are able to simply create erb files in folders like they are used to with static html or php and it just works. No futzing with routes, controllers etc.
Rails 5+ required.
Include in your Gemfile:
gem "rails-brochure"
Don't forget to install:
$ bundle install
$ rails generate brochure home
Write your static pages and put them in the RAILS_ROOT/app/views/home directory.
mkdir app/views/home
touch app/views/home/about.html.erb
After putting something interesting there, a named route is created and you can link to it from anywhere in your app with:
link_to "About", about_url
link_to "About", about_path
You can also create content in sub directories like this:
mkdir app/views/home/about
touch app/views/home/about/company
This will create a named route about_company:
link_to "Company", about_company_url
link_to "Company", about_company_path
Once you have an index template you may want to add this route to your config/routes.rb:
root :to => "home#index"
Named routes are good because if you change a page name (about.html.erb to about_us.html.erb) without updating the links you'll get failing tests:
ActionView::TemplateError: undefined local variable or method `about_path'
Some reasons you may want to override:
Create a HomeController of your own:
rails generate controller home
Then just add in the actions you want to behave differently:
class HomeController < ApplicationController
before_filter :require_user, :only => :private_info
def pricing
@prices = Price.all
end
def index
# index page has it's own layout html
render :layout => false
end
def private_info
@info = current_user.private_info
end
end
Enjoy!
Rails Brochure is Copyright © 2010-2024 Dan Hixon. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
FAQs
Unknown package
We found that rails-brochure demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.