diff --git a/Gemfile b/Gemfile
index ef8624c2..fa3db7b1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
diff --git a/Rakefile b/Rakefile
index 9439d3dd..553344b4 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,7 +4,7 @@ require 'rake/testtask'
require 'rdoc/task'
desc 'Default: run tests for all ORMs.'
-task :default => :test
+task default: :test
desc 'Run Devise tests for all ORMs.'
task :pre_commit do
diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb
index 9c27eb72..65ba2880 100644
--- a/app/views/devise/confirmations/new.html.erb
+++ b/app/views/devise/confirmations/new.html.erb
@@ -1,10 +1,10 @@
Resend confirmation instructions
-<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<%= f.submit "Resend confirmation instructions" %>
<% end %>
diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb
index 36670f91..dc55f64f 100644
--- a/app/views/devise/mailer/confirmation_instructions.html.erb
+++ b/app/views/devise/mailer/confirmation_instructions.html.erb
@@ -2,4 +2,4 @@
You can confirm your account email through the link below:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb
index 93de6d05..f667dc12 100644
--- a/app/views/devise/mailer/reset_password_instructions.html.erb
+++ b/app/views/devise/mailer/reset_password_instructions.html.erb
@@ -2,7 +2,7 @@
Someone has requested a link to change your password. You can do this through the link below.
-<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>
+<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.
diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb
index f59615fe..41e148bf 100644
--- a/app/views/devise/mailer/unlock_instructions.html.erb
+++ b/app/views/devise/mailer/unlock_instructions.html.erb
@@ -4,4 +4,4 @@
Click the link below to unlock your account:
-<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>
+<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb
index 70fb241b..55350988 100644
--- a/app/views/devise/passwords/edit.html.erb
+++ b/app/views/devise/passwords/edit.html.erb
@@ -1,14 +1,14 @@
Change your password
-<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<%= f.hidden_field :reset_password_token %>
<%= f.label :password, "New password" %>
- <%= f.password_field :password, :autofocus => true, :autocomplete => "off" %>
+ <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
<%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, :autocomplete => "off" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
<%= f.submit "Change my password" %>
<% end %>
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb
index 5a400df1..ea1d46e3 100644
--- a/app/views/devise/passwords/new.html.erb
+++ b/app/views/devise/passwords/new.html.erb
@@ -1,10 +1,10 @@
Forgot your password?
-<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<%= f.submit "Send me reset password instructions" %>
<% end %>
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index c251d4fd..808d62c9 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -1,29 +1,29 @@
Edit <%= resource_name.to_s.humanize %>
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
<% end %>
<%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, :autocomplete => "off" %>
+ <%= f.password_field :password, autocomplete: "off" %>
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, :autocomplete => "off" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
<%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password, :autocomplete => "off" %>
+ <%= f.password_field :current_password, autocomplete: "off" %>
<%= f.submit "Update" %>
<% end %>
Cancel my account
-Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>
+Unhappy? <%= button_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/new.html.erb b/app/views/devise/registrations/new.html.erb
index 53ce8051..234de913 100644
--- a/app/views/devise/registrations/new.html.erb
+++ b/app/views/devise/registrations/new.html.erb
@@ -1,16 +1,16 @@
Sign up
-<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
+<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<%= f.label :password %>
- <%= f.password_field :password, :autocomplete => "off" %>
+ <%= f.password_field :password, autocomplete: "off" %>
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, :autocomplete => "off" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
<%= f.submit "Sign up" %>
<% end %>
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index bc7adb42..f151ac1d 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -1,11 +1,11 @@
Sign in
-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
+<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<%= f.label :password %>
- <%= f.password_field :password, :autocomplete => "off" %>
+ <%= f.password_field :password, autocomplete: "off" %>
<% if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb
index 020787f8..6fb5612b 100644
--- a/app/views/devise/unlocks/new.html.erb
+++ b/app/views/devise/unlocks/new.html.erb
@@ -1,10 +1,10 @@
Resend unlock instructions
-<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+ <%= f.email_field :email, autofocus: true %>
<%= f.submit "Resend unlock instructions" %>
<% end %>
diff --git a/gemfiles/Gemfile.rails-3.2-stable b/gemfiles/Gemfile.rails-3.2-stable
index 38ecac8f..935e4271 100644
--- a/gemfiles/Gemfile.rails-3.2-stable
+++ b/gemfiles/Gemfile.rails-3.2-stable
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails', branch: '3-2-stable'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
diff --git a/gemfiles/Gemfile.rails-4.0-stable b/gemfiles/Gemfile.rails-4.0-stable
index 140edd06..2c514031 100644
--- a/gemfiles/Gemfile.rails-4.0-stable
+++ b/gemfiles/Gemfile.rails-4.0-stable
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails', branch: '4-0-stable'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.13.1", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.13.1", require: false
end
platforms :jruby do
diff --git a/gemfiles/Gemfile.rails-head b/gemfiles/Gemfile.rails-head
index 455a3df5..c0b1d996 100644
--- a/gemfiles/Gemfile.rails-head
+++ b/gemfiles/Gemfile.rails-head
@@ -1,6 +1,6 @@
source "https://rubygems.org"
-gemspec :path => '..'
+gemspec path: '..'
gem "rails", github: 'rails/rails'
gem "omniauth", "~> 1.0.0"
@@ -10,8 +10,8 @@ gem "rdoc"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid", "~> 1.0.1"
- gem "webrat", "0.7.3", :require => false
- gem "mocha", "~> 0.14", :require => false
+ gem "webrat", "0.7.3", require: false
+ gem "mocha", "~> 0.14", require: false
end
platforms :jruby do
diff --git a/lib/generators/templates/README b/lib/generators/templates/README
index f50fbb78..ba3ca6c8 100644
--- a/lib/generators/templates/README
+++ b/lib/generators/templates/README
@@ -6,14 +6,14 @@ Some setup you must do manually if you haven't yet:
is an example of default_url_options appropriate for a development environment
in config/environments/development.rb:
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+ config.action_mailer.default_url_options = { host: 'localhost:3000' }
In production, :host should be set to the actual host of your application.
2. Ensure you have defined root_url to *something* in your config/routes.rb.
For example:
- root :to => "home#index"
+ root to: "home#index"
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:
diff --git a/lib/generators/templates/markerb/confirmation_instructions.markerb b/lib/generators/templates/markerb/confirmation_instructions.markerb
index 8f152996..fe73f001 100644
--- a/lib/generators/templates/markerb/confirmation_instructions.markerb
+++ b/lib/generators/templates/markerb/confirmation_instructions.markerb
@@ -2,4 +2,4 @@ Welcome <%= @email %>!
You can confirm your account through the link below:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
diff --git a/lib/generators/templates/markerb/reset_password_instructions.markerb b/lib/generators/templates/markerb/reset_password_instructions.markerb
index d149c124..b1ca47ae 100644
--- a/lib/generators/templates/markerb/reset_password_instructions.markerb
+++ b/lib/generators/templates/markerb/reset_password_instructions.markerb
@@ -2,7 +2,7 @@ Hello <%= @resource.email %>!
Someone has requested a link to change your password, and you can do this through the link below.
-<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) %>
+<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.
diff --git a/lib/generators/templates/markerb/unlock_instructions.markerb b/lib/generators/templates/markerb/unlock_instructions.markerb
index 389db7e1..e3ed33d0 100644
--- a/lib/generators/templates/markerb/unlock_instructions.markerb
+++ b/lib/generators/templates/markerb/unlock_instructions.markerb
@@ -4,4 +4,4 @@ Your account has been locked due to an excessive number of unsuccessful sign in
Click the link below to unlock your account:
-<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) %>
+<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
diff --git a/lib/generators/templates/simple_form_for/confirmations/new.html.erb b/lib/generators/templates/simple_form_for/confirmations/new.html.erb
index c80829ad..949b1727 100644
--- a/lib/generators/templates/simple_form_for/confirmations/new.html.erb
+++ b/lib/generators/templates/simple_form_for/confirmations/new.html.erb
@@ -1,11 +1,11 @@
Resend confirmation instructions
-<%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :confirmation_token %>
- <%= f.input :email, :required => true, :autofocus => true %>
+ <%= f.input :email, required: true, autofocus: true %>
diff --git a/lib/generators/templates/simple_form_for/passwords/edit.html.erb b/lib/generators/templates/simple_form_for/passwords/edit.html.erb
index 5a2442a6..8f995edc 100644
--- a/lib/generators/templates/simple_form_for/passwords/edit.html.erb
+++ b/lib/generators/templates/simple_form_for/passwords/edit.html.erb
@@ -1,14 +1,14 @@
Change your password
-<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
+<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
- <%= f.input :reset_password_token, :as => :hidden %>
+ <%= f.input :reset_password_token, as: :hidden %>
<%= f.full_error :reset_password_token %>
- <%= f.input :password, :label => "New password", :required => true, :autofocus => true %>
- <%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>
+ <%= f.input :password, label: "New password", required: true, autofocus: true %>
+ <%= f.input :password_confirmation, label: "Confirm your new password", required: true %>