Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Fix: Devise & email tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
seawolf committed Jan 26, 2015
1 parent 633ddca commit a7f54e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/mailers/contact_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ContactMailer < ActionMailer::Base
def contact_email message, name, email, subject
@env = Rails.configuration.action_mailer.smtp_settings[:domain] || 'oddityavenue.com'
@env = Rails.configuration.action_mailer.smtp_settings.fetch(:domain) { 'oddityavenue.com' }
@time = Time.now.strftime("%d/%m/%Y %H:%M")
@from_name = name.to_s
@from_email = email.to_s
Expand Down
4 changes: 1 addition & 3 deletions app/models/admin/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ class Admin::User < ActiveRecord::Base
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, # :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
# attr_accessible :email, :password, :password_confirmation, :remember_me
end
end
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@

# Devise
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.smtp_settings = { :domain => 'localhost:3000' }
end
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

devise_for :users, path: 'admin', class_name: "Admin::User", skip: [:registrations]
as :user do
get 'users/edit' => 'devise/registrations#edit', as: 'edit_registration'
put 'users' => 'devise/registrations#update', as: 'registration'
get 'admin/users/edit' => 'devise/registrations#edit', as: 'edit_registration'
put 'admin/users/:id' => 'devise/registrations#update', :as => 'registration'
end

get "admin" => "application#admin"
Expand Down

0 comments on commit a7f54e1

Please sign in to comment.