Skip to content

Instantly share code, notes, and snippets.

View carmelyne's full-sized avatar
🏡
Working from home

Carmelyne Thompson carmelyne

🏡
Working from home
View GitHub Profile
==================
Fatal Error
If your blog does not display, please contact the owner of this site.
If you are the owner of this site please check that MySQL is running properly
and all tables are error free.
Database Tables Missing.
Database tables are missing. This means that MySQL is either not running,
# If cached file exists, serve it and stop processing
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L]
# other redirection (imgs, js, css, ...)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*/mephisto/.*
RewriteCond %{REQUEST_URI} !.*html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f
::
[]
**
-(unary) +(unary) ! ~
* / %
+ -
<< >>
&
| ^
> >= < <=
# more for routes
map.forgot_password '/forgot_password', :controller => 'users', :action => 'forgot_password'
map.reset_password '/reset_password', :controller => 'users', :action => 'reset_password'
# app/models/user_observer.rb
class UserObserver < ActiveRecord::Observer
def after_create(user)
UserNotifier.deliver_signup_notification(user)
end
Thank you!
<%= @user.login %>, your account has been activated.
You may now start using the member only features.
<%= @url %>
class UserNotifier < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += 'Please activate your new account'
@body[:url] = "#{HOST}/activate/#{user.activation_code}"
end
def activation(user)
setup_email(user)
# First, specify the Host that we will be using later for user_notifier.rb
HOST = 'http://www.yourrailsapp.com'
# Second, add the :user_observer
Rails::Initializer.run do |config|
# The user observer goes inside the Rails::Initializer block
config.active_record.observers = :user_observer
end
# Third, add your SMTP settings
# email
validates_format_of :email, :with => /(^([^@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i
# url
validates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
# password
validates_format_of :password, :with => /^\w+$/ (alphanumeric)
<%= stylesheet_tag 'my-site-wide-css' %>
<%= yield(:head_css) || (stylesheet_link_tag 'general_header_css') %>
cd /usr/local/src
curl -O http://umn.dl.sourceforge.net/sourceforge/ruby-ldap/ruby-ldap-0.9.7.tar.gz
tar xzvf ruby-ldap-0.9.7.tar.gz
cd ruby-ldap-0.9.7
ruby extconf.rb
make
make install