This file contains 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
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". |
This file contains 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
-----> Heroku receiving push | |
-----> Rails app detected | |
-----> Detected Rails is not set to serve static_assets | |
Installing rails3_serve_static_assets... done | |
-----> Configure Rails 3 to disable x-sendfile | |
Installing rails3_disable_x_sendfile... done | |
-----> Gemfile detected, running Bundler version 1.0.7 | |
Unresolved dependencies detected; Installing... | |
Windows Gemfile.lock detected, ignoring it. | |
You have modified your Gemfile in development but did not check |
This file contains 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
# users_controller | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
sign_in @user | |
flash[:success] = "Welcome to DanielG.dk!" | |
redirect_to @user # Redirects to the new users show page | |
else | |
@title = "Sign Up" | |
render 'new' |
This file contains 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
def create | |
@user = User.new(params[:user]) | |
if signed_in? | |
flash[:error] = "You cannot create a user while signed in" | |
redirect_to @user | |
else | |
if @user.save | |
sign_in @user | |
flash[:success] = "Welcome to DanielG.dk!" |
This file contains 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 UsersController < ApplicationController | |
include SessionsHelper | |
before_filter :authenticate, :only => [:index, :show, :edit, :update, :destroy] | |
before_filter :correct_user, :only => [:edit, :update] | |
before_filter :admin_user, :only => :destroy | |
before_filter :signed_in?, :only => [:new, :create] | |
def index | |
@title = "All users" |
This file contains 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 | |
@title = 'Sign In' | |
end | |
def create | |
# Use the authenticate method from the User model along with the parametres of :session to validate the user login | |
user = User.authenticate(params[:session][:email], params[:session][:password]) |
This file contains 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
body { | |
background: #ffffff url(/images/top_banner.png) repeat-x; | |
font-family:Arial, Helvetica, sans-serif; | |
} | |
header { | |
/*background: url(/images/top_banner.png) repeat-x;*/ | |
height: 96px; | |
width: 930px; } |
This file contains 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 PagesController < ApplicationController | |
def index | |
@page_title = "Advice Capital A/S - Index" | |
end | |
def contact | |
@page_title = "Advice Capital A/S - Contact" | |
end |
This file contains 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 EmployeesController < ApplicationController | |
def index | |
@employees = Employees.all | |
end | |
# GET /employees/1 | |
# GET /employees/1.xml | |
#def show | |
# @employee = Employee.find(params[:id]) |
This file contains 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
- @employees.each do |employees| | |
%span{:style=>"float:left;margin-right:20px;"}= image_tag @employees.image | |
%div{:style=>"float:left;margin-top:30px;"} | |
= @employees.name | |
, | |
= @employees.title | |
%br/ | |
%br/ | |
= mail_to @employees.email |