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 generate_password(length=6) | |
chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789' | |
password = '' | |
length.times { password << chars[rand(chars.length)] } | |
password | |
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
# Specifies gem version of Rails to use when vendor/rails is not present | |
RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION | |
# Bootstrap the Rails environment, frameworks, and default configuration | |
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
# Settings in config/environments/* take precedence those specified here | |
# Skip frameworks you're not going to use |
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
# hello world method | |
def hello | |
puts "hello world" | |
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
Passenger spawn server: symbol lookup error: /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/ext/passenger/native_support.so: undefined symbol: RARRAY_LEN | |
*** Exception NoMethodError in spawn manager (undefined method `[]' for nil:NilClass) (process 1336): | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/railz/framework_spawner.rb:89:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/spawn_manager.rb:218:in `spawn_rails_application' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/spawn_manager.rb:213:in `synchronize' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/spawn_manager.rb:213:in `spawn_rails_application' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/spawn_manager.rb:122:in `spawn_application' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/spawn_manager.rb:247:in `handle_spawn_application' | |
from /usr/lib/ruby/gems/1.8/gems/passenger-2.0.5/lib/passenger/abstract_server.rb:317:in `__send__' | |
fr |
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
Trevr:sitedemo travis$ cap app:switch -p | |
Password: | |
triggering start callbacks for `app:switch' | |
triggering before callbacks for `require_recipes' | |
* executing `validate_required_variables' | |
* executing `require_recipes' | |
* executing `app:switch' | |
* executing "gem list | grep passenger || echo 'ERROR'" | |
servers: ["sitedemo.plexusweb.com"] | |
[sitedemo.plexusweb.com] executing command |
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
# config.ru | |
require 'rubygems' | |
require 'merb-core' | |
Merb::Config.setup(:merb_root => ".", | |
:environment => ENV['RACK_ENV']) | |
Merb.environment = Merb::Config[:environment] | |
Merb.root = Merb::Config[:merb_root] | |
Merb::BootLoader.run |
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
<VirtualHost *:80> | |
ServerName listode.local | |
DocumentRoot "/Users/travis/apacheprojects/listode/public" | |
RackEnv development | |
<directory "/Users/travis/apacheprojects/listode/public"> | |
Order allow,deny | |
Allow from all | |
</directory> |
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
// function to send the jQuery form object via AJAX | |
jQuery.fn.submitWithAjax = function() { | |
this.submit(function() { | |
// be sure to add the '.js' part so that it knows this is format:js | |
$.post(this.action + '.js', $(this).serialize(), null, "script"); | |
return false; | |
}) | |
return this; | |
}; | |
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 mark_as_complete(id) | |
provides :js | |
# do work, son | |
# set instance variable to indicate success/failure | |
if stuff_done | |
@complete = true | |
end | |
render | |
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
- if @complete | |
$("#div_name_#{@record.id}").html('complete'); | |
$("#notes_#{@record.id}").replaceWith('<p>#{@record.notes}</p>'); | |
- else | |
alert("An error occurred processing your request."); |
OlderNewer