![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
h1. !http://railsapps.github.io/images/rails-36x36.jpg(RailsApps Page Gem)! RailsApps Pages Gem
Use this gem to add pages to a Rails application, including controllers, views, routing, and tests.
RailsApps Pages is a utility gem to use during development. You can remove it after generating the pages you need. It was originally written for use by the "Rails Composer":http://railsapps.github.io/rails-composer/ tool. Use Rails Composer to build any of the "RailApps example applications":http://railsapps.github.io/ for use as starter apps.
If you like the RailsApps Pages gem, you might be interested in the "RailsLayout gem":https://github.com/RailsApps/rails_layout which generates Rails application layout files for various front-end frameworks such as Bootstrap and Foundation.
h4. !http://railsapps.github.io/images/join/join-railsapps.png(Join RailsApps)!:http://railsapps.github.io/
h4. From the RailsApps Project
The "RailsApps":http://railsapps.github.io/ open source project offers starter applications and tutorials for Rails developers. Generate the applications with the Rails Composer tool.
All the code is explained in the Capstone Rails Tutorials. You can purchase the "Capstone Rails Tutorials":https://tutorials.railsapps.org/ to support the project.
h2. Install the Gem
Add the gem to your Rails application Gemfile:
group :development do gem 'rails_apps_pages' end
You don't need the RailsApps Pages 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_apps_pages', github: 'RailsApps/rails_apps_pages' end
h4. Use Bundler
Use Bundler to install the gems:
$ bundle install
h2. Generate a Home Page
To run the generator and create a home page:
$ rails generate pages:home
The generator will create:
It will add a route to the config/routes.rb file:
root :to => "visitors#index"
Why a "Visitors" controller? Why not a "Home" controller or "Welcome" controller? Those names are acceptable. But the home page often implements a user story for a persona named "visitor," so a "Visitors" controller is appropriate.
h2. Generate an "About" Page
To run the generator and create an "About" page:
$ rails generate pages:about
The generator will create:
You'll need to install the "high_voltage gem":https://github.com/thoughtbot/high_voltage for the "About" page. The high_voltage gem makes it easy to add pages with static content (text that doesn't change), incorporating a site-wide application layout. The high_voltage gem provides the controller and routes needed to display any pages found in the app/views/pages/ folder.
h2. Generate User Pages Requiring Authentication
If you have a User model and authentication with Devise or OmniAuth, you can add pages to display a list of users or each user's profile, restricted to signed in users.
To run the generator and create pages to accompany a User model:
$ rails generate pages:users
The generator will create:
It will also add routes to the config/routes.rb file.
h2. Generate User Pages Requiring Authorization
If you have a User model, authentication with Devise, and authorization with Pundit, you can add pages to display a list of users, restricted to an administrator. Each user can see his or her own profile if logged in.
To run the generator and create pages to accompany a User model with Pundit authorization:
$ rails generate pages:authorized
All files are identical to the @rails generate pages:users@ generator, except:
h2. Clean a Gemfile
Remove commented lines and multiple blank lines from a Gemfile:
$ rails generate clean:gemfile
h2. Clean a Routes File
Remove commented lines and multiple blank lines from the file config/routes.rb:
$ rails generate clean:routes
h2. Generate Analytics Files
Add a file containing JavaScript code to set up page-view tracking with "Google Analytics":http://www.google.com/analytics/:
$ rails generate analytics:google
Add a file containing JavaScript code to set up page-view tracking with "Segment.io":https://segment.io/:
$ rails generate analytics:segmentio
h2. Generate Bootstrap Page Layouts
See the "Start Bootstrap":http://startbootstrap.com/template-categories/all/ site for a collection of Bootstrap themes and templates that you can generate with the rails_apps_pages gem.
Here are the Bootstrap page layouts you can generate:
1) None 2) 1 Col Portfolio 3) 2 Col Portfolio 4) 3 Col Portfolio 5) 4 Col Portfolio 6) Bare 7) Blog Home 8) Business Casual 9) Business Frontpage 10) Clean Blog 11) Full Width Pics 12) Heroic Features 13) Landing Page 14) Modern Business 15) One Page Wonder 16) Portfolio Item 17) Round About 18) Shop Homepage 19) Shop Item 20) Simple Sidebar 21) Small Business 22) Stylish Portfolio 23) The Big Picture 24) Thumbnail Gallery
To see the commands that generate the Bootstrap page layouts, run:
$ rails g
h2. Issues
Any issues? Please create an "issue":http://github.com/RailsApps/rails_apps_pages/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_apps_pages/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 © 2014 Daniel Kehoe
h2. Useful Links
|. Getting Started |. Articles |_. Tutorials | | "Ruby on Rails":http://railsapps.github.io/ruby-and-rails.html | "Analytics for Rails":http://railsapps.github.io/rails-google-analytics.html | "Rails Bootstrap":http://railsapps.github.io/twitter-bootstrap-rails.html | | "What is Ruby on Rails?":http://railsapps.github.io/what-is-ruby-rails.html | "Heroku and Rails":http://railsapps.github.io/rails-heroku-tutorial.html | "Rails Foundation":http://railsapps.github.io/rails-foundation.html | | "Learn Ruby on Rails":http://learn-rails.com/learn-ruby-on-rails.html | "JavaScript and Rails":http://railsapps.github.io/rails-javascript-include-external.html | "RSpec Tutorial":http://railsapps.github.io/rspec.html | | "Rails Tutorial":https://tutorials.railsapps.org/rails-tutorial | "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html | "Rails Devise Tutorial":http://railsapps.github.io/tutorial-rails-devise.html | | "Ruby on Rails Tutorial for Beginners":http://learn-rails.com/ruby-on-rails-tutorial-for-beginners | "Git and GitHub with Rails":http://railsapps.github.io/rails-git.html | "Devise RSpec":http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html | | "Install Ruby on Rails":http://railsapps.github.io/installing-rails.html | "Send Email with Rails":http://railsapps.github.io/rails-send-email.html | "Devise Bootstrap":http://railsapps.github.io/tutorial-rails-bootstrap-devise-cancan.html | | "Install Ruby on Rails - Mac OS X":http://railsapps.github.io/installrubyonrails-mac.html | "Haml and Rails":http://railsapps.github.io/rails-haml.html | "Rails Membership Site with Stripe":https://tutorials.railsapps.org/rails-stripe-membership-saas | | "Install Ruby on Rails - Ubuntu":http://railsapps.github.io/installrubyonrails-ubuntu.html | "Rails Application Layout":http://railsapps.github.io/rails-default-application-layout.html | "Rails Subscription Site with Recurly":https://tutorials.railsapps.org/rails-recurly-subscription-saas | | "Ruby on Rails - Nitrous.io":http://railsapps.github.io/rubyonrails-nitrous-io.html | "HTML5 Boilerplate for Rails":http://railsapps.github.io/rails-html5-boilerplate.html | "Startup Prelaunch Signup Application":https://tutorials.railsapps.org/rails-prelaunch-signup | | "Update Rails":http://railsapps.github.io/updating-rails.html | "Example Gemfiles for Rails":http://railsapps.github.io/rails-3-2-example-gemfile.html | | "Rails Composer":http://railsapps.github.io/rails-composer/ | "Rails Application Templates":http://railsapps.github.io/rails-application-templates.html | | "Rails Examples":http://railsapps.github.io/ | "Rails Product Planning":http://railsapps.github.io/rails-product-planning.html | | "Rails Starter Apps":http://railsapps.github.io/rails-examples-tutorials.html | "Rails Project Management":http://railsapps.github.io/rails-project-management.html |
FAQs
Unknown package
We found that rails_apps_pages 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.