This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================== | |
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: | |
[] | |
** | |
-(unary) +(unary) ! ~ | |
* / % | |
+ - | |
<< >> | |
& | |
| ^ | |
> >= < <= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you! | |
<%= @user.login %>, your account has been activated. | |
You may now start using the member only features. | |
<%= @url %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= stylesheet_tag 'my-site-wide-css' %> | |
<%= yield(:head_css) || (stylesheet_link_tag 'general_header_css') %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |