gem install rails
rails new my_app -T
ENV["RAILS_ENV"] ||= 'test' | |
# begin | |
# require 'rubygems' | |
# require 'spork' | |
# rescue LoadError => e | |
# end | |
def load_all(*patterns) | |
patterns.each { |pattern| Dir[pattern].sort.each { |path| load File.expand_path(path) } } |
namespace :db do | |
desc "create db copy file" | |
task :sgl_dump => :environment do | |
system "cp #{Rails.root}/db/development.sqlite3 #{Rails.root}/db/#{Date.today.to_s.split('-').join}-devdb" | |
end | |
desc "load latest db file" | |
task :sgl_load => :environment do | |
puts "Are you sure you want over write your database? YES/NO" | |
yn = STDIN.gets |
multiuser on | |
acladd user1,user2,user3 | |
vbell off | |
hardstatus string "%1`" | |
# change the hardstatus settings to give an window list at the bottom of | |
# the screen, with the time and date and with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' |
module ApplicationHelper | |
# Simple Navigation | |
# navigation nav_elements, :selected_class => "foo" | |
def navigation(links=[],options={}) | |
path = (options[:controller_only] == true) ? controller.controller_name.to_sym : request.path | |
content_tag :ul, :class => (options[:class] || 'navigation') do | |
links.each do |link| | |
klass = (path == link[:path]) ? options[:selected_class] || 'current' : "" |