diff --git a/.gitignore b/.gitignore index cce3516..dc1f87d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,8 +27,11 @@ db/*.sqlite3 .rspec .redcar/ .sass-cache -/config/config.yml +/config/application.yml /config/database.yml +/config/config.yml +/config/local_env.yml +/config/secrets.yml /coverage.data /coverage/ /db/*.javadb/ @@ -37,6 +40,7 @@ db/*.sqlite3 /doc/app/ /doc/features.html /doc/specs.html +/fork_data /public/cache /public/stylesheets/compiled /public/system/* @@ -72,6 +76,3 @@ pickle-email-*.html # vim artifacts **.swp - -# Ignore application configuration -/config/application.yml diff --git a/.ruby-gemset b/.ruby-gemset index 1f0d951..d5c6ad2 100644 --- a/.ruby-gemset +++ b/.ruby-gemset @@ -1 +1 @@ -rails-prelaunch-signup +Rails4.2_prelaunch diff --git a/.ruby-version b/.ruby-version index 227cea2..c043eea 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.0.0 +2.2.1 diff --git a/Gemfile b/Gemfile index ad6b4bb..a34ab17 100644 --- a/Gemfile +++ b/Gemfile @@ -1,27 +1,39 @@ source 'https://rubygems.org' -gem 'rails', '3.2.13' +ruby '2.2.1' +gem 'rails', '4.2.1' +gem 'rubyzip', '~> 1.0.0' gem 'sqlite3' -group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - gem 'uglifier', '>= 1.0.3' +group :development, :test do + gem 'binding_of_caller', '~> 0.7.2', platforms: [:mri_19, :rbx] + gem 'rspec-rails', '>= 2.12.2' + gem 'sass-rails', '~> 5.0' + gem 'factory_girl_rails', '>= 4.2.0' end +group :test do + gem 'cucumber-rails', '>= 1.3.1', require: false + gem 'capybara', '>= 2.0.3' + gem 'database_cleaner', '>= 1.0.0.RC1' + gem 'email_spec', '>= 1.4.0' + gem 'launchy', '>= 2.2.0' + gem 'pry' +end +group :development do + gem 'quiet_assets', '>= 1.0.2' + gem 'better_errors', '>= 0.7.2' + gem 'spring', '~> 1.3.4' +end +gem 'bootstrap-sass', '~> 3.3.4.1' +gem 'cancan', '>= 1.6.9' +gem 'coffee-rails', '~> 4.1.0' +gem 'devise', '>= 2.2.3' +gem 'gibbon', git: 'git://github.com/amro/gibbon.git' gem 'jquery-rails' -gem "rspec-rails", ">= 2.12.2", :group => [:development, :test] -gem "database_cleaner", ">= 1.0.0.RC1", :group => :test -gem "email_spec", ">= 1.4.0", :group => :test -gem "cucumber-rails", ">= 1.3.1", :group => :test, :require => false -gem "launchy", ">= 2.2.0", :group => :test -gem "capybara", ">= 2.0.3", :group => :test -gem "factory_girl_rails", ">= 4.2.0", :group => [:development, :test] -gem "bootstrap-sass", ">= 2.3.0.0" -gem "devise", ">= 2.2.3" -gem "cancan", ">= 1.6.9" -gem "rolify", ">= 3.2.0" -gem "simple_form", ">= 2.1.0" -gem "gibbon", ">= 0.4.2" -gem "selenium-webdriver", "~> 2.32.1" -gem "quiet_assets", ">= 1.0.2", :group => :development -gem "figaro", ">= 0.6.3" -gem "better_errors", ">= 0.7.2", :group => :development -gem "binding_of_caller", ">= 0.7.1", :group => :development, :platforms => [:mri_19, :rbx] \ No newline at end of file +gem 'protected_attributes' +gem 'railties', '~> 4.2.0' +gem 'rolify', '>= 3.2.0' +gem 'responders', '~> 2.0' +gem 'rubygems-update', '~> 2.4.6' +gem 'selenium-webdriver', '~> 2.45.0' +gem 'simple_form', '>= 2.1.0' +gem 'uglifier', '~> 2.7.1' +gem 'web-console', '~> 2.0' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index ce95bad..4cf214d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,191 +1,242 @@ +GIT + remote: git://github.com/amro/gibbon.git + revision: 1d8ee00f576d354d5cc1f5bd1ec166d8565db1ca + specs: + gibbon (1.1.5) + httparty + multi_json (>= 1.9.0) + GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) + actionmailer (4.2.1) + actionpack (= 4.2.1) + actionview (= 4.2.1) + activejob (= 4.2.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.1) + actionview (= 4.2.1) + activesupport (= 4.2.1) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + actionview (4.2.1) + activesupport (= 4.2.1) + builder (~> 3.1) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) - addressable (2.3.4) - arel (3.0.2) - bcrypt-ruby (3.0.1) - better_errors (0.8.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + activejob (4.2.1) + activesupport (= 4.2.1) + globalid (>= 0.3.0) + activemodel (4.2.1) + activesupport (= 4.2.1) + builder (~> 3.1) + activerecord (4.2.1) + activemodel (= 4.2.1) + activesupport (= 4.2.1) + arel (~> 6.0) + activesupport (4.2.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.3.8) + arel (6.0.0) + autoprefixer-rails (5.1.9) + execjs + json + bcrypt (3.1.10) + better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) - binding_of_caller (0.7.1) + rack (>= 0.9.0) + binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (2.3.1.0) - sass (~> 3.2) - builder (3.0.4) + bootstrap-sass (3.3.4.1) + autoprefixer-rails (>= 5.0.0.1) + sass (>= 3.2.19) + builder (3.2.2) cancan (1.6.10) - capybara (2.1.0) + capybara (2.4.4) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - childprocess (0.3.9) + childprocess (0.5.6) ffi (~> 1.0, >= 1.0.11) - coderay (1.0.9) - coffee-rails (3.2.2) + coderay (1.1.0) + coffee-rails (4.1.0) coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) + railties (>= 4.0.0, < 5.0) + coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.6.2) - cucumber (1.3.2) + coffee-script-source (1.9.1.1) + cucumber (1.3.19) builder (>= 2.1.2) diff-lcs (>= 1.1.3) - gherkin (~> 2.12.0) - multi_json (~> 1.3) - cucumber-rails (1.3.1) - capybara (>= 1.1.2) - cucumber (>= 1.2.0) - nokogiri (>= 1.5.0) - rails (~> 3.0) - database_cleaner (1.0.1) + gherkin (~> 2.12) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.2) + cucumber-rails (1.4.2) + capybara (>= 1.1.2, < 3) + cucumber (>= 1.3.8, < 2) + mime-types (>= 1.16, < 3) + nokogiri (~> 1.5) + rails (>= 3, < 5) + database_cleaner (1.4.1) debug_inspector (0.0.2) - devise (2.2.4) - bcrypt-ruby (~> 3.0) + devise (3.4.1) + bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (~> 3.1) - warden (~> 1.2.1) - diff-lcs (1.2.4) - email_spec (1.4.0) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + diff-lcs (1.2.5) + email_spec (1.6.0) launchy (~> 2.1) mail (~> 2.2) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) - factory_girl (4.2.0) + execjs (2.5.2) + factory_girl (4.5.0) activesupport (>= 3.0.0) - factory_girl_rails (4.2.1) - factory_girl (~> 4.2.0) + factory_girl_rails (4.5.0) + factory_girl (~> 4.5.0) railties (>= 3.0.0) - ffi (1.8.1) - figaro (0.6.4) - bundler (~> 1.0) - rails (>= 3, < 5) - gherkin (2.12.0) + ffi (1.9.8) + gherkin (2.12.2) multi_json (~> 1.3) - gibbon (0.4.6) - httparty - multi_json (>= 1.3.4) - hike (1.2.2) - httparty (0.11.0) - multi_json (~> 1.0) + globalid (0.3.5) + activesupport (>= 4.1.0) + httparty (0.13.3) + json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.6.1) - journey (1.0.4) - jquery-rails (2.2.1) - railties (>= 3.0, < 5.0) + i18n (0.7.0) + jquery-rails (4.0.3) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.0) - launchy (2.3.0) + json (1.8.2) + launchy (2.4.3) addressable (~> 2.3) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.23) - multi_json (1.7.3) - multi_xml (0.5.3) - nokogiri (1.5.9) - orm_adapter (0.4.0) - polyglot (0.3.3) - quiet_assets (1.0.2) + loofah (2.0.1) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + method_source (0.8.2) + mime-types (2.4.3) + mini_portile (0.6.2) + minitest (5.6.0) + multi_json (1.11.0) + multi_test (0.1.2) + multi_xml (0.5.5) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + orm_adapter (0.5.0) + protected_attributes (1.0.9) + activemodel (>= 4.0.1, < 5.0) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + quiet_assets (1.1.0) railties (>= 3.1, < 5.0) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack - rack-test (0.6.2) + rack (1.6.0) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) - bundler (~> 1.0) - railties (= 3.2.13) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) + rails (4.2.1) + actionmailer (= 4.2.1) + actionpack (= 4.2.1) + actionview (= 4.2.1) + activejob (= 4.2.1) + activemodel (= 4.2.1) + activerecord (= 4.2.1) + activesupport (= 4.2.1) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.1) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.6) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) + railties (4.2.1) + actionpack (= 4.2.1) + activesupport (= 4.2.1) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.0.4) - rdoc (3.12.2) - json (~> 1.4) - rolify (3.2.0) - rspec-core (2.13.1) - rspec-expectations (2.13.0) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.1) - rspec-rails (2.13.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - rubyzip (0.9.9) - sass (3.2.9) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - selenium-webdriver (2.32.1) - childprocess (>= 0.2.5) - multi_json (~> 1.0) - rubyzip - websocket (~> 1.0.4) - simple_form (2.1.0) - actionpack (~> 3.0) - activemodel (~> 3.0) - sprockets (2.2.2) - hike (~> 1.2) + thor (>= 0.18.1, < 2.0) + rake (10.4.2) + responders (2.1.0) + railties (>= 4.2.0, < 5) + rolify (4.0.0) + rspec-core (3.2.3) + rspec-support (~> 3.2.0) + rspec-expectations (3.2.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.2.0) + rspec-mocks (3.2.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.2.0) + rspec-rails (3.2.1) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.2.0) + rspec-expectations (~> 3.2.0) + rspec-mocks (~> 3.2.0) + rspec-support (~> 3.2.0) + rspec-support (3.2.2) + rubygems-update (2.4.6) + rubyzip (1.0.0) + sass (3.4.13) + sass-rails (5.0.3) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (~> 1.1) + selenium-webdriver (2.45.0) + childprocess (~> 0.5) multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0) + simple_form (3.1.0) + actionpack (~> 4.0) + activemodel (~> 4.0) + slop (3.6.0) + spring (1.3.4) + sprockets (3.0.0) rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - thor (0.18.1) + sprockets-rails (2.2.4) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) + sqlite3 (1.3.10) + thor (0.19.1) + thread_safe (0.3.5) tilt (1.4.1) - treetop (1.4.12) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.37) - uglifier (2.1.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.1) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) + json (>= 1.8.0) + warden (1.2.3) rack (>= 1.0) - websocket (1.0.7) + web-console (2.1.2) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + websocket (1.2.1) xpath (2.0.0) nokogiri (~> 1.3) @@ -194,26 +245,33 @@ PLATFORMS DEPENDENCIES better_errors (>= 0.7.2) - binding_of_caller (>= 0.7.1) - bootstrap-sass (>= 2.3.0.0) + binding_of_caller (~> 0.7.2) + bootstrap-sass (~> 3.3.4.1) cancan (>= 1.6.9) capybara (>= 2.0.3) - coffee-rails (~> 3.2.1) + coffee-rails (~> 4.1.0) cucumber-rails (>= 1.3.1) database_cleaner (>= 1.0.0.RC1) devise (>= 2.2.3) email_spec (>= 1.4.0) factory_girl_rails (>= 4.2.0) - figaro (>= 0.6.3) - gibbon (>= 0.4.2) + gibbon! jquery-rails launchy (>= 2.2.0) + protected_attributes + pry quiet_assets (>= 1.0.2) - rails (= 3.2.13) + rails (= 4.2.1) + railties (~> 4.2.0) + responders (~> 2.0) rolify (>= 3.2.0) rspec-rails (>= 2.12.2) - sass-rails (~> 3.2.3) - selenium-webdriver (~> 2.32.1) + rubygems-update (~> 2.4.6) + rubyzip (~> 1.0.0) + sass-rails (~> 5.0) + selenium-webdriver (~> 2.45.0) simple_form (>= 2.1.0) + spring (~> 1.3.4) sqlite3 - uglifier (>= 1.0.3) + uglifier (~> 2.7.1) + web-console (~> 2.0) diff --git a/README b/README index b26ea68..af3553e 100644 --- a/README +++ b/README @@ -1,19 +1,18 @@ Rails Prelaunch Signup ======================== -An example Rails 3.2 app for a web startup prelaunch page. +Note of 20150413 : this application is currently being updated to Ruby 2.2.1, Rails 4.2.1. -You can use this project as a starting point for a Rails web application. It requires Rails 3.2 or newer and uses Devise http://github.com/plataformatec/devise for user management and authentication. -________________________ +What began as an example Rails 3.2 app for a web startup prelaunch page, is being brought current. -See the README file on GitHub +________________________ -For more information, please see the updated README file on GitHub: +For more information, please see the README file on GitHub: https://github.com/railsapps/rails-prelaunch-signup ________________________ -License +MIT License -Contact the author for license terms. \ No newline at end of file +Copyright © 2012-2015 Daniel Kehoe \ No newline at end of file diff --git a/README.textile b/README.textile index 697df7e..244bba5 100644 --- a/README.textile +++ b/README.textile @@ -1,10 +1,12 @@ h1. !http://railsapps.github.io/images/rails-36x36.jpg(Rails App for a Startup Prelaunch Signup Site)! Rails App for a Startup Prelaunch Signup Site -Rails 3.2 example application for a “beta launching soon” startup prelaunch signup site. +Note of 20150413 : This fork of the original Rails 3.2 example application for a “beta launching soon” startup prelaunch signup site, is currently being updated to Rails 4.2.1 Ruby 2.2.1. + +Please refer to the original materials : * "Rails Prelaunch Signup App":http://railsapps.github.io/rails-prelaunch-signup/ project page -Best of all, there's a "detailed tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup to show how it is built. +Best of all, there's a "detailed tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup to show how it is built. Go 'Hobo' for free access. You can build this application in only a few minutes using the "Rails Composer":http://railsapps.github.io/rails-composer/ tool. @@ -12,593 +14,17 @@ You can build this application in only a few minutes using the "Rails Composer": Read an "interview with Michael Gajda":http://blog.railsapps.org/post/22543541226/powered-up-by-the-railsapps-project-xplaygrounds-com about how he used the project to launch his startup site. -h4. Notable Forks - -|_. Alternative version |_. |_. Author | -| "rails-prelaunch-signup-1click":https://github.com/chadokruse/rails-prelaunch-signup-1click | single-click email submit (no modal) | "Chad Kruse":http://twitter.com/chadkruser | - h2. !http://twitter-badges.s3.amazonaws.com/t_logo-a.png(Follow on Twitter)!:http://www.twitter.com/rails_apps Follow on Twitter -Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps. Please tweet some praise if you like what you've found. +Follow the RailsApps projects on Twitter: "@rails_apps":http://twitter.com/rails_apps. Please tweet some praise to Daniel if you like what you've found. h2. Introduction The initial app for a typical web startup announces the founders' plans and encourages visitors to enter an email address for future notification of the site launch. It's not difficult to build such an app in Rails. -But why build it yourself if others have already done so? This project aims to: - -* eliminate effort spent building an application that meets a common need; -* offer code that is already implemented and tested by a large community; -* provide a well-thought-out app containing most of the features you'll need. - -By using code from this project, you'll be able to: - -* direct your attention to the design and product offer for your prelaunch site; -* get started faster building the ultimate application for your business. - -h2. What Is Implemented — and What Is Not - -This is a complete and fully functional application. - -h4. For the user: - -* an offer with a "request invite" button -* a "request invitation" form in a modal window -* "Thank you" acknowledgement includes social sharing buttons (Twitter, Facebook, Google+) -* visitor receives an email acknowledging their request -* visitor's request for an invitation creates an "unconfirmed" account -* a welcome email when a user is invited by a site administrator -* a link in the welcome email confirms the user's account and sets a password - -h4. For the site owner: - -* administrative dashboard page -* list of all visitors who have requested invitations -* site owner can send individual invitations -* "bulk invitation" feature to send 50, 100, or more invitations -* see status for any user: "uninvited", "confirmed", "last visit" - -h4. Implementation details: - -* Twitter Bootstrap -* modal window for invitation requests updated by AJAX -* Javascript updates the modal window for any form submission errors -* uses an email service provider for transactional email -* captures visitor email addresses for a MailChimp mailing list - -h4. Tutorial shows how to: - -* write user stories -* use Devise for user management and authentication -* use CanCan for role-based authorization -* keep account passwords secret using environment variables -* use git and GitHub for source control -* deploy using Heroku - -h4. Unimplemented - -* queuing (asynchronous processing) for transactional email and MailChimp list capture -* caching -* A/B testing of offers -* Google analytics -* "about" and "contact" pages - -If you add features or improve the implementation, please consider contributing by submitting an issue or pull request from your fork. - -h2. Alternatives - -This is an application for Rails developers who wish to deploy their own application. It is a good stepping stone to building a more complex application for your startup. You'll own your own code and can customize to your needs. - -Unlike a service such as "LaunchRock":http://launchrock.co/, "KickoffLabs":http://kickofflabs.com/ and "Unbounce":http://unbounce.com/, you'll have your own application you can customize as you wish. Just as important, when your visitors sign up, they are creating real user accounts in a user management system you can use after you launch. - -If you do not want to build an application, or you are not a Rails developer, you may wish to consider alternatives. - -h3. Hosted Services - -* "LaunchRock":http://launchrock.com/ - "set up a social launching-soon page in minutes" -* "KickoffLabs":http://www.kickofflabs.com/ - "viral landing pages you'll love in 60 seconds" -* "Prefinery":http://www.prefinery.com/ - "complete beta management platform that encourages social sharing" -* "Unbounce":http://unbounce.com/ - "create, publish & A/B test landing pages" - -h3. WordPress Themes - -WordPress themes are a popular way to stage a startup prelaunch page. - -* "Launch Effect":http://launcheffectapp.com/ - "a WordPress theme for viral launches" - -h3. Similar Projects - -You can find other projects on GitHub that offer similar functionality. - -|_. Author |_. Project |_. Description | -| codelitt | "launchpage-rails":https://github.com/codelitt/launchpage-rails | Signup for two different types of users | -| johngrimes | "t-minus":https://github.com/johngrimes/t-minus | Instant prelaunch page for your Rails 3 app | -| renderedtext | "coming-soon":https://github.com/renderedtext/coming-soon | Sinatra app to show a pre-launch page and collect emails | -| hashrocket | "coming-soon":https://github.com/hashrocket/coming-soon | Sinatra app to register email addresses | -| jbeyers | "django-prelaunch":https://github.com/jbeyers/django-prelaunch | Django app to gather email addresses with a referral mechanism | - -Found others? Please create an issue with your suggestion or email the author. - -h3. Articles and Discussion - -Here are some articles that describe the purpose and options for a startup prelaunch page: - -* "Building An Effective 'Coming Soon' Page for Your Product":http://www.smashingmagazine.com/2011/05/24/building-an-effective-coming-soon-page-for-your-product/ from Smashing Magazine -* "Elements Of A Viral Launch Page":http://spking.com/2011/08/30/roll-your-own-pre-launch-page/ from Smashing Magazine -* "Which Are the Best Startup Prelaunch Pages?":http://www.quora.com/Which-are-the-best-startup-prelaunch-pages from Quora - -Have other suggestions? Please create an issue with your suggestion or email the author. - -h2. RailsApps Examples and Tutorials - -This is one in a series of Rails example apps and tutorials from the "RailsApps Project":http://railsapps.github.io/. - -This application is based on two of the RailsApps example apps: - -* "rails3-devise-rspec-cucumber":https://github.com/RailsApps/rails3-devise-rspec-cucumber -* "rails3-bootstrap-devise-cancan":https://github.com/RailsApps/rails3-bootstrap-devise-cancan - -The first example shows how to set up Devise for user authentication. It also shows how to set up the app to use RSpec and Cucumber for testing. - -The second example shows how to set up Devise and add CanCan to manage access to administrative pages. It also shows how to set up Twitter Bootstrap as a front-end framework for CSS styling. - -You can use this example without studying these example applications; if you find you are lost, it may be helpful to look at the two simpler examples. - -If you want to use the MongoDB datastore instead of ActiveRecord and a SQL database, look at "rails3-mongoid-devise":https://github.com/RailsApps/rails3-mongoid-devise example. - -h2. Tutorial - -An in-depth tutorial is available (subscription required). Subscriptions provide financial support for the RailsApps project. - -You can use the starter app without getting the tutorial. The tutorial provides a detailed explanation of the code: - -h4. "Get the Tutorial":https://tutorials.railsapps.org/rails-prelaunch-signup - -The tutorial documents each step to follow to create the application. Every step is documented concisely, so a complete beginner can create this application without any additional knowledge. However, no explanation is offered for any of the steps, so if you are a beginner, you’re advised to look for an introduction to Rails elsewhere. If you’re new to Rails, see recommendations for a "Rails tutorial":https://tutorials.railsapps.org/rails-tutorial and a list of top resources for "Ruby and Rails":http://railsapps.github.io/ruby-and-rails.html. The article "What is Ruby? And Rails?":http://railsapps.github.io/what-is-ruby-rails.html is a good place to get a basic introduction to Rails. - -If you simply wish to modify the application for your own project, you can generate the application and set it up as described below, without following the tutorial. - -h2. Dependencies - -Before generating your application, you will need: - -* The Ruby language (version 1.9.3 or 2.0.0) -* The Rails gem (version 3.2.13) - -See "Installing Rails":http://railsapps.github.io/installing-rails.html for detailed instructions and advice. - -h2. Accounts You May Need - -Before you start, you may need to set up accounts for hosting and email. - -h3. Hosting - -For easy deployment, use a "platform as a service" provider such as: - -* "Heroku":http://www.heroku.com/ -* "CloudFoundry":http://www.cloudfoundry.com/ -* "EngineYard":http://www.engineyard.com/ -* "OpenShift":https://openshift.redhat.com/app/ - -Instructions are provided for deployment to Heroku. - -h3. Transactional Email - -For simple testing of email, it's easy to use Gmail to send email messages from the application. For deployment, when the application must send dozens or thousands of acknowledgments or invitations, you will need a hosted SMTP relay service (also known as an ESP or "email service provider"). We provide instructions for "Mandrill by MailChimp":http://mandrill.com/. The Mandrill transactional email service integrates well with the MailChimp email list manager service. Plus, you can send up to 12,000 emails/month from the service for free. - -Sign up for a MailChimp account to get started. After you've created your MailChimp account, see the instructions to "Use Mandrill with MailChimp":http://help.mandrill.com/customer/portal/articles/464750-use-mandrill-with-mailchimp. Then get the "Access Information":http://help.mandrill.com/customer/portal/articles/464828-access-information (your SMTP username and password, which is an API key). - -h3. Mailing List - -In addition to sending transactional email messages, you likely will want to send newsletters or announcements to your entire mailing list. The tutorial shows how to add visitors who request an invitation to a "MailChimp":http://mailchimp.com/ list. MailChimp allows you to send up to 12,000 emails/month to list of 2000 or fewer subscribers for free. After you sign up for a MailChimp account, get your API key. Look under "Account" for "API Keys and Authorized Apps." Note that the Mandrill API key (which you get on the "mandrill.com":http://mandrill.com/ site) is different from the MailChimp API key (which you get on the "mailchimp.com":http://mailchimp.com/ site). - -h2. Getting the Application - -You have several options for getting the code. You can _fork_, _clone_, or _generate_. - -h3. Fork - -If you'd like to add features (or bug fixes) to improve the example application, you can fork the GitHub repo and "make pull requests":http://help.github.com/send-pull-requests/. Your code contributions are welcome! - -h3. Clone - -If you want to copy and customize the app with changes that are only useful for your own project, you can clone the GitHub repo. You'll need to search-and-replace the project name throughout the application. You probably should generate the app instead (see below). To clone: - -
-$ git clone git://github.com/RailsApps/rails-prelaunch-signup.git
-
- -You'll need "git":http://git-scm.com/ on your machine. See "Rails and Git":http://railsapps.github.io/rails-git.html. - -h3. Generate - -If you want to use the project as a starter app, use the "Rails Composer":http://railsapps.github.io/rails-composer/ tool to generate a new version of the example app. You'll be able to give it your own project name when you generate the app. Generating the application gives you many additional options. - -To build the example application, run the command: - -
-$ rails new rails-prelaunch-signup -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T
-
- -Use the @-T@ flag to skip Test::Unit files. - -The @$@ character indicates a shell prompt; don't include it when you run the command. - -This creates a new Rails app named @rails-prelaunch-signup@ on your computer. You can use a different name if you wish. - -You'll see a prompt: - -
-question  Install an example application?
-      1)  I want to build my own application
-      2)  membership/subscription/saas
-      3)  rails-prelaunch-signup
-      4)  rails3-bootstrap-devise-cancan
-      5)  rails3-devise-rspec-cucumber
-      6)  rails3-mongoid-devise
-      7)  rails3-mongoid-omniauth
-      8)  rails3-subdomains
-
- -Choose *rails-prelaunch-signup*. The Rails Composer tool may give you other options (other choices may have been added since these notes were written). - -The application generator template will ask you for additional preferences: - -
- question  Git branch for the prelaunch app?
-       1)  wip (work-in-progress)
-       2)  master
-       3)  prelaunch
-       4)  staging
- question  Git branch for the main app?
-       1)  None
-       2)  wip (work-in-progress)
-       3)  edge
- question  Web server for development?
-       1)  WEBrick (default)
-       2)  Thin
-       3)  Unicorn
-       4)  Puma
- question  Web server for production?
-       1)  Same as development
-       2)  Thin
-       3)  Unicorn
-       4)  Puma
- question  Template engine?
-       1)  ERB
-       2)  Haml
-       3)  Slim
-   extras  Set a robots.txt file to ban spiders? (y/n)
-   extras  Use or create a project-specific rvm gemset? (y/n)
-   extras  Create a GitHub repository? (y/n)
-
- -h4. Git Branches - -The application template will create Git branches for you. This allows you to maintain two versions of the application: one for immdediate deployment as a prelaunch app; and another version that you can use for ongoing development. I recommend deploying the prelaunch app in the "master" branch. Work on your ultimate application in a "wip" branch. - -h4. Web Servers - -We recommend Thin in development for speed and less noise in the log files. - -If you plan to deploy to Heroku, select Thin as your production webserver. - -h4. Template Engine - -The example application uses the default "ERB" Rails template engine. Optionally, you can use another template engine, such as Haml or Slim. See instructions for "Haml and Rails":http://railsapps.github.io/rails-haml.html. - -h4. Other Choices - -Set a robots.txt file to ban spiders if you want to keep your new site out of Google search results. - -It is a good idea to use "rvm":https://rvm.io/, the Ruby Version Manager, and create a project-specific rvm gemset (not available on Windows). See "Installing Rails":http://railsapps.github.io/installing-rails.html. - -If you choose to create a GitHub repository, the generator will prompt you for a GitHub username and password. - -h4. Troubleshooting - -If you get an error "OpenSSL certificate verify failed" or "Gem::RemoteFetcher::FetchError: SSL_connect" see the article "OpenSSL errors and Rails":http://railsapps.github.io/openssl-certificate-verify-failed.html. - -If you get an error like this: - -
-Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
-    composer  Running 'after bundler' callbacks.
-The template [...] could not be loaded.
-Error: You have already activated ..., but your Gemfile requires ....
-Using bundle exec may solve this.
-
- -It's due to conflicting gem versions. See the article "Rails Error: “You have already activated (…)”":http://railsapps.github.io/rails-error-you-have-already-activated.html. - -h3. Edit the README - -If you're storing the app in a GitHub repository, please edit the README files to add a description of the app and your contact info. If you don't change the README, people will think I am the author of your version of the application. - -h2. Getting Started - -See the article "Installing Rails":http://railsapps.github.io/installing-rails.html to make sure your development environment is prepared properly. - -h3. Use RVM - -I recommend using "rvm":https://rvm.io/, the Ruby Version Manager, to create a project-specific gemset for the application. If you generate the application with the Rails Composer tool, you can create a project-specific gemset. - -h3. Install the Required Gems - -Check the Gemfile to see which gems are used by this application. - -If you used the "Rails Composer":http://railsapps.github.io/rails-composer/ tool to generate the example app, the application template script has already run the @bundle install@ command. - -If not, you should run the @bundle install@ command to install the required gems on your computer: - -
-$ bundle install
-
- -You can check which gems are installed on your computer with: - -
-$ gem list
-
- -Keep in mind that you have installed these gems locally. When you deploy the app to another server, the same gems (and versions) must be available. - -I recommend using "rvm":https://rvm.io/, the Ruby Version Manager, to create a project-specific gemset for the application. See the article "Installing Rails":http://railsapps.github.io/installing-rails.html. - -h3. Configure Email - -You must configure the application for your email account. See the article "Send Email with Rails":http://railsapps.github.io/rails-send-email.html. - -h3. Configure Devise - -You can modify the configuration file for Devise if you want to use something other than the defaults: - -* *config/initializers/devise.rb* - -h3. Configuration File - -The application uses the "figaro gem":https://github.com/laserlemon/figaro to set environment variables. Credentials for your administrator account and email account are set in the *config/application.yml* file. The *.gitignore* file prevents the *config/application.yml* file from being saved in the git repository so your credentials are kept private. See the article "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html for more information. - -Modify the file *config/application.yml*: - -
-# Add account credentials and API keys here.
-# See http://railsapps.github.io/rails-environment-variables.html
-# This file should be listed in .gitignore to keep your settings secret!
-# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
-# For example, setting:
-# GMAIL_USERNAME: Your_Gmail_Username
-# makes 'Your_Gmail_Username' available as ENV["GMAIL_USERNAME"]
-# Add application configuration variables here, as shown below.
-#
-MANDRILL_USERNAME: Your_Username
-MANDRILL_API_KEY: Your_Mandrill_API_Key
-MAILCHIMP_API_KEY: Your_MailChimp_API_Key
-MAILCHIMP_LIST_ID: My_List_ID
-ADMIN_NAME: First User
-ADMIN_EMAIL: user@example.com
-ADMIN_PASSWORD: changeme
-ROLES: [admin, user]
-EMAIL_ADDRESS: user@example.com
-DOMAIN: example.com
-
- -We use Mandrill to increase deliverability for email messages from the application. Provide a @MANDRILL_USERNAME@ and @MANDRILL_API_KEY@. - -When visitors sign up to be notified of our launch, we'll add them to a MailChimp list. Add an environment variable for the MailChimp API key: @MAILCHIMP_API_KEY@. You can find the MailChimp API key under the tab for "Account" on the MailChimp website after you log in. Look for the "Api Keys and Authorized Apps" menu item. - -We'll add @MAILCHIMP_LIST_ID@ for the ID of the mailing list we'll set up in MailChimp. To find the list ID, on the MailChimp "Lists" page, look for the dropdown "gear" menu for the mailing list you've created and click "List Settings and Unique ID." At the bottom of the List Settings page, you'll find the unique ID for the mailing list. - -If you wish, set your name, email address, and password for an administrator's account. If you prefer, you can use the default to sign in to the application and edit the account after deployment. It is always a good idea to change the administrator's password after the application is deployed. - -Specify roles in the configuration file. You will need an "admin" role and "user" role. Remove the "VIP" role as we won't use it. - -We'll add @EMAIL_ADDRESS@ to provide the default sender email address we use when sending email from the application. - -Finally, we'll add @DOMAIN@ which is also used when sending email. - -All configuration values in the *config/application.yml* file are available anywhere in the application as environment variables. For example, @ENV["GMAIL_USERNAME"]@ will return the string "Your_Username". - -If you prefer, you can delete the *config/application.yml* file and set each value as an environment variable in the Unix shell. - -h3. Set Up a Database Seed File - -The *db/seeds.rb* file initializes the database with default values. To keep some data private, and consolidate configuration settings in a single location, we use the *config/application.yml* file to set environment variables and then use the environment variables in the *db/seeds.rb* file. - -
-puts 'ROLES'
-YAML.load(ENV['ROLES']).each do |role|
-  Role.find_or_create_by_name({ :name => role }, :without_protection => true)
-  puts 'role: ' << role
-end
-puts 'DEFAULT USERS'
-user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
-puts 'user: ' << user.name
-user.add_role :admin
-user.skip_confirmation!
-user.save!
-
- -The *db/seeds.rb* file reads a list of roles from the *config/application.yml* file and adds the roles to the database. In fact, any new role can be added to the roles datatable with a statement such @user.add_role :superhero@. Setting the roles in the *db/seeds.rb* file simply makes sure each role is listed and available. - -You can change the administrator name, email, and password in this file but it is better to make the changes in the *config/application.yml* file to keep the credentials private. If you decide to include your private password in the *db/seeds.rb* file, be sure to add the filename to your *.gitignore* file so that your password doesn't become available in your public GitHub repository. - -Note that it's not necessary to personalize the *db/seeds.rb* file before you deploy your app. You can deploy the app with an example user and then use the application's "Edit Account" feature to change name, email address, and password after you log in. Use this feature to log in as an administrator and change the user name and password to your own. - -Don't overlook the @user.skip_confirmation!@ and @user.save!@ statements. This application uses the Devise Confirmable module to require that a user confirm a new account by clicking on a link in an email message. You won't be sending the administrator an email message with a confirmation link so you must set the account with the @user.skip_confirmation!@ and @user.save!@ statements. - -You may wish to include additional sample users: - -
-user2 = User.find_or_create_by_email :name => 'Second User', :email => 'user2@example.com', :password => 'changeme', :password_confirmation => 'changeme'
-puts 'user: ' << user2.name
-user2.add_role :VIP
-
- -This will add a second user to the database with a "VIP" role. - -h3. Set the Database - -Prepare the database and add the default user to the database by running the commands: - -
-$ rake db:migrate
-$ rake db:seed
-
- -Use @rake db:reset@ if you want to empty and reseed the database. - -Set the database for running tests: - -
-$ rake db:test:prepare
-
- -If you’re not using "rvm":https://rvm.io/, the Ruby Version Manager, you should preface each rake command with @bundle exec@. You don’t need to use @bundle exec@ if you are using rvm version 1.11.0 or newer. - -h3. Change your Application's Secret Token - -If you've used the Rails Composer tool to generate the application, the application's secret token will be unique, just as with any Rails application generated with the @rails new@ command. - -However, if you've cloned the application directly from GitHub, it is crucial that you change the application's secret token before deploying your application in production mode. Otherwise, people could change their session information, and potentially access your site without permission. Your secret token should be at least 30 characters long and completely random. - -Get a unique secret token: - -
-rake secret
-
- -Edit your *config/initializers/secret_token.rb* file to add the secret token: - -
-RailsPrelaunchSignup::Application.config.secret_token = '...some really long, random string...'
-
- -h2. Test the App - -You can check that your app runs properly by entering the command - -@$ rails server@ - -To see your application in action, open a browser window and navigate to "http://localhost:3000/":http://localhost:3000. - -Sign in as the first user (the administrator) using: - -* email: user@example.com -* password: changeme - -You'll see a navigation link for Admin. Clicking the link will display a page with a list of users at -"http://localhost:3000/users":http://localhost:3000/users. - -If you want to see what the administrative dashboard looks like with many users, you can add a line to the *db/seeds.rb* file to create a hundred bogus users: - -
-100.times {|i| User.create! :name => "User #{i+3}", :email => "user#{i+3}@example.com", :password => 'changeme', :password_confirmation => 'changeme'}
-
- -Then run @$ rake db:reset@ to recreate the database and visit the site again. - -h2. Deploy to Heroku - -Heroku provides low cost, easily configured Rails application hosting. - -For your convenience, here is a "Tutorial for Rails on Heroku":http://railsapps.github.io/rails-heroku-tutorial.html. See the article for details about preparing your application to deploy to Heroku. - -Be sure to set up SSL before you make your application available in production. See the "Heroku documentation on SSL":https://devcenter.heroku.com/articles/ssl or use CloudFlare as described in the tutorial. - -After you've prepared your application as described in the "Tutorial for Rails on Heroku":http://railsapps.github.io/rails-heroku-tutorial.html article, precompile assets, commit to git, and push to Heroku: - -
-$ rake assets:precompile
-$ git add -A
-$ git commit -m "assets compiled for Heroku"
-$ git push heroku master
-
- -You'll need to set the configuration values from the *config/application.yml* file as Heroku environment variables. See the article "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html for more information. - -With the figaro gem, just run: - -
-$ rake figaro:heroku
-
- -Alternatively, you can set Heroku environment variables directly. - -Here's how to set environment variables directly on Heroku with @heroku config:add@. - -
-$ heroku config:add MANDRILL_USERNAME='Your_Username' MANDRILL_API_KEY='Your_Mandrill_API_Key'
-$ heroku config:add MAILCHIMP_LIST_ID='Your_List_ID'
-$ heroku config:add ADMIN_NAME='First User' ADMIN_EMAIL='user@example.com' ADMIN_PASSWORD='changeme'
-$ heroku config:add 'ROLES=[admin, user]'
-$ heroku config:add EMAIL_ADDRESS='me@example.com' DOMAIN='example.com'
-
- -Complete Heroku deployment with: - -
-$ heroku run rake db:migrate
-$ heroku run rake db:seed
-
- -h2. Testing - -The example application contains a suite of RSpec unit tests and Cucumber scenarios and step definitions. - -After installing the application, run @rake -T@ to check that rake tasks for RSpec and Cucumber are available. - -Run @rake spec@ to run RSpec tests. - -Run @rake cucumber@ (or more simply, @cucumber@) to run Cucumber scenarios. - -Please send the author a message, create an issue, or submit a pull request if you can contribute improved RSpec or Cucumber files. - -h2. Issues - -Please create a "GitHub issue":http://github.com/RailsApps/rails-prelaunch-signup/issues if you identify any problems or have suggestions for improvements. - -h2. Where to Get Help - -Your best source for help with problems is "Stack Overflow":http://stackoverflow.com/questions/tagged/ruby-on-rails-3. Your issue may have been encountered and addressed by others. - -You can also try "Rails Hotline":http://www.railshotline.com/, a free telephone hotline for Rails help staffed by volunteers. - -h2. Contributing - -If you make improvements to this application, please share with others. - -Send the author a message, create an "issue":http://github.com/RailsApps/rails-prelaunch-signup/issues, or fork the project and submit a pull request. - -If you add functionality to this application, create an alternative implementation, or build an application that is similar, please contact me and I'll add a note to the README so that others can find your work. - -h2. Credits - -Daniel Kehoe implemented the application and wrote the tutorial. - -Is the app useful to you? Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps -and tweet some praise. I'd love to know you were helped out by what I've put together. - -h2. MIT License - -"MIT License":http://www.opensource.org/licenses/mit-license - -Copyright © 2012 Daniel Kehoe - -h2. Useful Links +But why build it yourself if others have already done so? -|_. Getting Started |_. Articles |_. Tutorials | -| "Learn Rails":http://learn-rails.com/ | "Twitter Bootstrap and Rails":http://railsapps.github.io/twitter-bootstrap-rails.html | "Rails and Bootstrap":http://railsapps.github.io/rails-bootstrap/ | -| "Ruby and Rails":http://railsapps.github.io/ruby-and-rails.html | "Analytics for Rails":http://railsapps.github.io/rails-google-analytics.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 | "Devise with CanCan and Twitter Bootstrap":https://tutorials.railsapps.org/rails3-bootstrap-devise-cancan | -| "Rails Tutorial":https://tutorials.railsapps.org/rails-tutorial | "JavaScript and Rails":http://railsapps.github.io/rails-javascript-include-external.html | "Rails Membership Site with Stripe":https://tutorials.railsapps.org/rails-stripe-membership-saas | -| "Installing Rails":http://railsapps.github.io/installing-rails.html | "Rails Environment Variables":http://railsapps.github.io/rails-environment-variables.html | "Rails Subscription Site with Recurly":https://tutorials.railsapps.org/rails-recurly-subscription-saas | -| "Updating Rails":http://railsapps.github.io/updating-rails.html | "Git and Rails":http://railsapps.github.io/rails-git.html | "Startup Prelaunch Signup Application":http://railsapps.github.io/tutorial-rails-prelaunch-signup.html | -| "Rails Composer":http://railsapps.github.io/rails-composer/ | "Email and Rails":http://railsapps.github.io/rails-send-email.html | "Devise with RSpec and Cucumber":http://railsapps.github.io/tutorial-rails-devise-rspec-cucumber.html | -| "Rails Examples":http://railsapps.github.io/ | "Haml and Rails":http://railsapps.github.io/rails-haml.html | "Devise with Mongoid":http://railsapps.github.io/tutorial-rails-mongoid-devise.html | -| "Rails Starter Apps":http://railsapps.github.io/rails-examples-tutorials.html | "Rails Application Layout":http://railsapps.github.io/rails-default-application-layout.html | "OmniAuth with Mongoid":http://railsapps.github.io/tutorial-rails-mongoid-omniauth.html | -| | "HTML5 Boilerplate for Rails":http://railsapps.github.io/rails-html5-boilerplate.html | "Subdomains with Devise":http://railsapps.github.io/tutorial-rails-subdomains.html | -| | "Example Gemfiles for Rails":http://railsapps.github.io/rails-3-2-example-gemfile.html | | -| | "Rails Application Templates":http://railsapps.github.io/rails-application-templates.html | | +To continue reading and to see the reasons, please see the : "Rails Prelaunch Signup App":http://railsapps.github.io/rails-prelaunch-signup/ project page -!https://cruel-carlota.pagodabox.com/6ffdc588dd4075aa7827bd7806ed40f7(githalytics.com alpha)! +Kathy Onu +a SiteKeeper diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.scss b/app/assets/stylesheets/bootstrap_and_overrides.css.scss index fc66ab6..43df589 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.scss +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.scss @@ -1,3 +1,2 @@ @import "bootstrap"; body { padding-top: 60px; } -@import "bootstrap-responsive"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f9a089f..d142970 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base protect_from_forgery rescue_from CanCan::AccessDenied do |exception| - redirect_to root_path, :alert => exception.message + redirect_to root_path, alert: exception.message end end diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index b85b490..e12aacb 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -8,7 +8,7 @@ class ConfirmationsController < Devise::PasswordsController def create self.resource = resource_class.send_confirmation_instructions(resource_params) if successfully_sent?(resource) - respond_with({}, :location => after_resending_confirmation_instructions_path_for(resource_name)) + respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name)) else respond_with(resource) end @@ -26,7 +26,7 @@ def update @confirmable.errors.clear #so that we won't render :new end else - self.class.add_error_on(self, :email, :password_allready_set) + self.class.add_error_on(self, :email, :password_already_set) end end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 308a177..92a535c 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -1,22 +1,26 @@ class RegistrationsController < Devise::RegistrationsController + helper_method :resource, :resource_name, :devise_mapping # 20150412 addition # override #create to respond to AJAX with a partial def create build_resource + #build_resource(sign_up_params) + resource.email = resource_params[:email] + # ^^ ref https://github.com/RailsApps/rails-prelaunch-signup/commit/ec01a952b56ccf49b4dfa4d529caea22b4dbdae8 if resource.save if resource.active_for_authentication? sign_in(resource_name, resource) - (render(:partial => 'thankyou', :layout => false) && return) if request.xhr? - respond_with resource, :location => after_sign_up_path_for(resource) + (render(partial: 'thankyou', layout: false) && return) if request.xhr? + respond_with resource, location: after_sign_up_path_for(resource) else - expire_session_data_after_sign_in! - (render(:partial => 'thankyou', :layout => false) && return) if request.xhr? - respond_with resource, :location => after_inactive_sign_up_path_for(resource) + expire_data_after_sign_in! + (render(partial: 'thankyou', layout: false) && return) if request.xhr? + respond_with resource, location: after_inactive_sign_up_path_for(resource) end else clean_up_passwords resource - render :action => :new, :layout => !request.xhr? + render action: :new, layout: !request.xhr? end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 125c23c..364996a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,7 @@ class UsersController < ApplicationController before_filter :authenticate_user! def index - authorize! :index, @user, :message => 'Not authorized as an administrator.' + authorize! :index, @user, message: 'Not authorized as an administrator.' @users = User.all end @@ -11,41 +11,41 @@ def show end def update - authorize! :update, @user, :message => 'Not authorized as an administrator.' + authorize! :update, @user, message: 'Not authorized as an administrator.' @user = User.find(params[:id]) - if @user.update_attributes(params[:user], :as => :admin) - redirect_to users_path, :notice => "User updated." + if @user.update_attributes(params[:user], as: :admin) + redirect_to users_path, notice: "User updated." else - redirect_to users_path, :alert => "Unable to update user." + redirect_to users_path, alert: "Unable to update user." end end def destroy - authorize! :destroy, @user, :message => 'Not authorized as an administrator.' + authorize! :destroy, @user, message: 'Not authorized as an administrator.' user = User.find(params[:id]) unless user == current_user user.destroy - redirect_to users_path, :notice => "User deleted." + redirect_to users_path, notice: "User deleted." else - redirect_to users_path, :notice => "Can't delete yourself." + redirect_to users_path, notice: "Can't delete yourself." end end def invite - authorize! :invite, @user, :message => 'Not authorized as an administrator.' + authorize! :invite, @user, message: 'Not authorized as an administrator.' @user = User.find(params[:id]) @user.send_confirmation_instructions - redirect_to :back, :only_path => true, :notice => "Sent invitation to #{@user.email}." + redirect_to :back, only_path: true, notice: "Sent invitation to #{@user.email}." end def bulk_invite - authorize! :bulk_invite, @user, :message => 'Not authorized as an administrator.' - users = User.where(:confirmation_token => nil).order(:created_at).limit(params[:quantity]) + authorize! :bulk_invite, @user, message: 'Not authorized as an administrator.' + users = User.where(confirmation_token: nil).order(:created_at).limit(params[:quantity]) count = users.count users.each do |user| user.send_confirmation_instructions end - redirect_to :back, :only_path => true, :notice => "Sent invitation to #{count} users." + redirect_to :back, only_path: true, notice: "Sent invitation to #{count} users." end end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 80dd22b..983a996 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,8 +1,8 @@ class UserMailer < ActionMailer::Base - default :from => ENV["EMAIL_ADDRESS"] + default from: ENV["EMAIL_ADDRESS"] def welcome_email(user) - mail(:to => user.email, :subject => "Invitation Request Received") + mail(to: user.email, subject: "Invitation Request Received") headers['X-MC-GoogleAnalytics'] = ENV["DOMAIN"] headers['X-MC-Tags'] = "welcome" end diff --git a/app/models/role.rb b/app/models/role.rb index 145baa7..b966425 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -1,6 +1,6 @@ class Role < ActiveRecord::Base - has_and_belongs_to_many :users, :join_table => :users_roles - belongs_to :resource, :polymorphic => true + has_and_belongs_to_many :users, join_table: :users_roles + belongs_to :resource, polymorphic: true scopify end diff --git a/app/models/user.rb b/app/models/user.rb index 01fdb05..8b5a9c0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,15 +5,13 @@ class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable - # Setup accessible (or protected) attributes for your model - attr_accessible :name, :email, :password, :password_confirmation, :remember_me - after_create :add_user_to_mailchimp before_destroy :remove_user_from_mailchimp # override Devise method # no password is required when the account is created; validate password when the user sets one validates_confirmation_of :password + def password_required? if !persisted? !(password != "") @@ -41,7 +39,7 @@ def send_reset_password_instructions end # new function to set the password - def attempt_set_password(params) + def attempt_set_password(id_params) p = {} p[:password] = params[:password] p[:password_confirmation] = params[:password_confirmation] @@ -60,15 +58,21 @@ def only_if_unconfirmed private + # using strong_parameters + def id_params + require(:user).permit(:email, :password, :password_confirmation) + #require(:user).permit(:name, :email, :password, :password_confirmation, :remember_me) + end + def add_user_to_mailchimp return if email.include?(ENV['ADMIN_EMAIL']) mailchimp = Gibbon::API.new result = mailchimp.lists.subscribe({ - :id => ENV['MAILCHIMP_LIST_ID'], - :email => {:email => self.email}, - :double_optin => false, - :update_existing => true, - :send_welcome => true + id: ENV['MAILCHIMP_LIST_ID'], + email: { email: self.email }, + double_optin: false, + update_existing: true, + send_welcome: true }) Rails.logger.info("Subscribed #{self.email} to MailChimp") if result end @@ -76,11 +80,11 @@ def add_user_to_mailchimp def remove_user_from_mailchimp mailchimp = Gibbon::API.new result = mailchimp.lists.unsubscribe({ - :id => ENV['MAILCHIMP_LIST_ID'], - :email => {:email => self.email}, - :delete_member => true, - :send_goodbye => false, - :send_notify => true + id: ENV['MAILCHIMP_LIST_ID'], + email: { email: self.email}, + delete_member: true, + send_goodbye: false, + send_notify: true }) Rails.logger.info("Unsubscribed #{self.email} from MailChimp") if result end diff --git a/app/views/devise/confirmations/show.html.erb b/app/views/devise/confirmations/show.html.erb index fe8c0a1..e819418 100644 --- a/app/views/devise/confirmations/show.html.erb +++ b/app/views/devise/confirmations/show.html.erb @@ -1,5 +1,5 @@

Account Activation

-<%= simple_form_for resource, :as => resource_name, :url => update_user_confirmation_path, :html => {:class => 'form-horizontal', :method => 'put'}, :id => 'activation-form' do |f| %> +<%= simple_form_for resource, as: resource_name, url: update_user_confirmation_path, html: { class: 'form-horizontal', method: 'put' }, id: 'activation-form' do |f| %> <%= devise_error_messages! %>
diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index 7077efe..0da47ee 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -4,4 +4,4 @@

Please click the link below to confirm your email address and set your password:

-

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

+

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) %>

diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 4ac1775..85ed775 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,14 +1,14 @@

Edit <%= resource_name.to_s.humanize %>

-<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-vertical' }) do |f| %> +<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-vertical' }) do |f| %> <%= f.error_notification %> <%= display_base_errors resource %> - <%= f.input :name, :autofocus => true %> - <%= f.input :email, :required => true %> - <%= f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false %> - <%= f.input :password_confirmation, :required => false %> - <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %> - <%= f.button :submit, 'Update', :class => 'btn-primary' %> + <%= f.input :name, autofocus: true %> + <%= f.input :email, required: true %> + <%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %> + <%= f.input :password_confirmation, required: false %> + <%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %> + <%= f.button :submit, 'Update', class: 'btn-primary' %> <% end %>

Cancel my account

-

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.

+

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.

<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml new file mode 100644 index 0000000..6ebfd54 --- /dev/null +++ b/app/views/devise/registrations/edit.html.haml @@ -0,0 +1,27 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> +

<%= f.label :name %>
+<%= f.text_field :name %>

+ +
<%= f.label :email %>
+ <%= f.email_field :email %>
+ +
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "off" %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
+ +
<%= f.submit "Update" %>
+<% end %> + +

Cancel my account

+ +

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.

+ +<%= link_to "Back", :back %> \ No newline at end of file diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index cef4671..ce2f757 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,15 +1,15 @@