Skip to content

Instantly share code, notes, and snippets.

@gmgp
gmgp / gist:1836228
Created February 15, 2012 14:34 — forked from fro/gist:1683557
the_sortable_tree gem: erb version of partials
# _children.html.erb
<%= content_tag :ol, raw(children) %>
# _controls.html.erb
<%-
edit = link_to '', polymorphic_url(opts[:namespace] + [node], :action => :edit), :title => t('.edit_this'), :class => 'button edit'
if opts[:has_children]
delete = link_to('', url_for(opts[:namespace] + [node]),
:title => t('.delete'),
:method => :delete,
@gmgp
gmgp / spec_helper.rb
Created November 21, 2011 12:30 — forked from bsodmike/spec_helper.rb
RSpec + Cucumber BDD Stack for Rails 3 with Spork and Guard

RSpec + Cucumber BDD Stack for Rails 3 with Spork and Guard

Steps to follow, Ref:

  • Update Gemfile
  • bundle install
  • rails g rspec:install
  • Edit .rspec
it:
errors:
messages:
not_found: "non trovato"
already_confirmed: "è stato già confermato"
not_locked: "non era bloccato"
devise:
failure:
unauthenticated: "Devi accedere o registrarti per continuare."
@gmgp
gmgp / heroku.rake
Created July 22, 2010 16:25 — forked from jqr/heroku.rake
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