gem install rails --pre
rails new my_app -T
namespace :heroku do | |
desc "Generate the Heroku gems manifest from gem dependencies" | |
task :gems do | |
RAILS_ENV='production' | |
Rake::Task[:environment].invoke | |
list = Rails.configuration.gems.collect do |g| | |
command, *options = g.send(:install_command) | |
options.join(" ") + "\n" | |
end | |
bin/cucumber --require features/ features/example-script.feature |
# Everything you need to do to get started with Rails 2.3.8 | |
# | |
# As of June 14th, 2010 @ 2:30 p.m. MST | |
# | |
# This gist now features instructions to get Rails 3 up and running with: | |
# - Ruby 1.8.7-p174 | |
# - Bundler 0.9.26 | |
# - Cucumber 0.8.0 | |
# - Rspec 1.3.0 + Rspec-Rails 1.3.2 | |
# - RVM |
Rails CMS alternatives | |
====================== | |
Active projects: | |
--------------- | |
adva-cms | |
repo: http://github.com/svenfuchs/adva_cms/ | |
site: http://adva-cms.org/ | |
Last update: 11/24/09 | |
"the cutting edge Rails CMS platform" |
module ApplicationHelper | |
def breadcrumb(url, options = {}) | |
options.reverse_merge!( :separator => ' » ', | |
:home_link => 'Home') | |
path_segments = url.sub(/\?.*/,'').split('/')[1..-1] | |
return '' if path_segments.blank? # ie: suppress breadcrumbs on homepage |
# see http://www.aeonscope.net/2010/02/22/managing-multiple-heroku-accounts/ | |
# INTRODUCTION | |
# This script echos the active Heroku credentials (useful when switching between multiple Heroku accounts | |
# and remembering which one is active). | |
# USAGE | |
# ruby credentials.rb |
# LDAP Configuration | |
development: | |
host: localhost | |
port: 636 | |
base: ou=bar,dc=foo,dc=com | |
admin_user: cn=admin,dc=foo,dc=com | |
admin_password: password | |
ssl: false | |
production: |
In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.
It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.
you might want to take a look at a demo app
class Klass | |
def initialize(number) | |
self.number = number | |
end | |
attr_reader :number | |
private | |
attr_writer :number |