README.textile in rails_apps_pages-0.4.0 vs README.textile in rails_apps_pages-0.4.1
- old
+ new
@@ -1,8 +1,8 @@
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, and routing.
+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.
@@ -50,10 +50,11 @@
The generator will create:
* app/views/visitors/index.html.erb
* app/controllers/visitors_controller.rb
+* plus tests (if RSpec is installed)
It will add a route to the *config/routes.rb* file:
<pre>
root :to => "visitors#index"
@@ -70,68 +71,58 @@
</pre>
The generator will create:
* app/views/pages/about.html.erb
+* plus tests (if RSpec is installed)
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, you might want to add pages to display a list of users or each user's profile, restricted to logged in users.
+If you have a User model and authentication with Devise, 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:
<pre>
$ rails generate pages:users
</pre>
The generator will create:
-* app/views/visitors/index.html.erb
+* app/controllers/registrations_controller.rb
+* app/controllers/users_controller.rb
* app/controllers/visitors_controller.rb
* app/views/users/_user.html.erb
* app/views/users/index.html.erb
* app/views/users/show.html.erb
-* app/controllers/users_controller.rb
+* app/views/visitors/index.html.erb
+* plus tests (if RSpec is installed)
It will add routes to the *config/routes.rb* file:
<pre>
-resources :users
root :to => "visitors#index"
+devise_for :users, :controllers => {:registrations => "registrations"}
+resources :users
</pre>
h2. Generate User Pages Requiring Authorization
-If you have a User model, authentication with Devise, and authorization with Pundit, you might want to add pages to display a list of users, restricted to an administrator. Each user can see his or her own profile if logged in.
+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:
+To run the generator and create pages to accompany a User model with Pundit authorization:
<pre>
$ rails generate pages:authorized
</pre>
-The generator will create:
-
-* app/views/visitors/index.html.erb
-* app/controllers/visitors_controller.rb
-* app/views/users/_user.html.erb
-* app/views/users/index.html.erb
-* app/views/users/show.html.erb
-* app/controllers/users_controller.rb
-
-It will add routes to the *config/routes.rb* file:
-
-<pre>
-resources :users
-root :to => "visitors#index"
-</pre>
-
All files are identical to the @rails generate pages:users@ generator, except:
* app/views/users/_user.html.erb
* app/controllers/users_controller.rb
+* app/policies/user_policy.rb
+* plus tests (if RSpec is installed)
h2. Clean a Gemfile
Remove commented lines and multiple blank lines from a Gemfile: