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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install make build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget --no-clobber ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
def current_ability | |
@current_ability ||= Ability.new(current_member) | |
end | |
rescue_from CanCan::AccessDenied do |exception| | |
flash[:alert] = "Access Denied." | |
redirect_to root_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 SessionsController < ApplicationController | |
def new | |
if member = Member.find_by_password_digest(cookies[:digest]) | |
session[:member_id] = member.id | |
redirect_to (session[:ref] || root_path), :notice => "Welcome back #{member.first_name}" | |
end | |
end | |
def create |
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
<h2>Log In</h2> | |
<%= form_tag sessions_path do %> | |
<div class="field"> | |
<%= label_tag :user_name %><br> | |
<%= text_field_tag :user_name, params['user_name'] %> | |
</div> | |
<p></p> | |
<div class="field"> | |
<%= label_tag :password %><br/> |