Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Sessions Controller
- class SessionController < ApplicationController
- def create
- session[:password] = params[:password]
- flash[:notice] = "Successfully Logged In"
- redirect_to :controller => 'brokers', :action => 'index'
- end
- def destroy
- reset_session
- flash[:notice] = "Successfully Logged Out"
- redirect_to login_path
- end
- end
- ## Routes
- ActionController::Routing::Routes.draw do |map|
- map.resources :brokers, :session
- map.login 'login', :controller => 'session', :action => 'create'
- map.logout 'logout', :controller => 'session', :action => 'destroy'
- map.connect ':controller/:action/:id'
- map.connect ':controller/:action/:id.:format'
- end
Add Comment
Please, Sign In to add comment