Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: orenomba/rails_tutorial
base: 09b90243ad
...
head fork: orenomba/rails_tutorial
compare: 9c4e7f2cc7
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
2  .gitignore
@@ -13,3 +13,5 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
+
+public/assets
View
5 .gmail
@@ -0,0 +1,5 @@
+sender: sender@gmail.com
+recipients:
+ - your@gmail.com
+user_name: your login name
+password: password
View
5 Gemfile
@@ -18,6 +18,11 @@ gem 'squeel'
gem 'formtastic-bootstrap', :git => "https://github.com/niedfelj/formtastic-bootstrap.git", :branch => 'bootstrap2-rails3-2-formtastic-2-2'
gem "i18n_generators"
+#http://stackoverflow.com/questions/3524127/exception-notification-gem-and-rails-3
+#https://github.com/smartinez87/exception_notification
+gem 'exception_notification', :require => 'exception_notifier'
+
+
# Gems used only for assets and not required
# in production environments by default.
group :assets do
View
3  Gemfile.lock
@@ -76,6 +76,8 @@ GEM
unf (~> 0.0.3)
erubis (2.7.0)
eventmachine (0.12.10)
+ exception_notification (2.6.1)
+ actionmailer (>= 3.0.4)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.0.0)
@@ -251,6 +253,7 @@ DEPENDENCIES
annotate!
capybara!
coffee-rails (~> 3.2.1)
+ exception_notification
factory_girl_rails
formtastic-bootstrap!
growl
View
4 app/controllers/home_controller.rb
@@ -1,2 +1,6 @@
class HomeController < ApplicationController
+
+ def raise
+ 1/0
+ end
end
View
2  app/views/home/index.html.erb
@@ -2,6 +2,8 @@
<h1>welcome</h1>
</div>
+<h1><%= link_to "強制エラー(Production時にメールで通知)", raise_path %></h1>
+
<% if logged_in? %>
<h1><%= link_to "秘密のリンク", user_path(current_user) %></h1>
<% end %>
View
18 config/environments/production.rb
@@ -15,7 +15,7 @@
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
- config.assets.compile = false
+ config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
@@ -64,4 +64,20 @@
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ gmail = YAML.load(File.read File.join(Rails.root, ".gmail"))
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.smtp_settings = {
+ :address => "smtp.gmail.com",
+ :port => 587,
+ :user_name => gmail["user_name"],
+ :password => gmail["password"],
+ :authentication => 'plain',
+ :enable_starttls_auto => true }
+
+ config.middleware.use ExceptionNotifier,
+ :email_prefix => "[exception] ",
+ :sender_address => %{"notifier" <#{gmail["sender"]}>},
+ :exception_recipients => Array(gmail["recipients"])
+
end
View
2  config/routes.rb
@@ -5,6 +5,8 @@
resources :users
resources :sessions
+ get "raise" => "home#raise", :as => "raise"
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
0  false
No changes.

No commit comments for this range

Something went wrong with that request. Please try again.