Skip to content

Instantly share code, notes, and snippets.

View Florent2's full-sized avatar

Florent Guilleux Florent2

View GitHub Profile
From 4db593a42a01d59aecf723f07a6df372d6d48135 Mon Sep 17 00:00:00 2001
From: Florent Guilleux <[email protected]>
Date: Tue, 27 Oct 2009 11:27:15 -0500
Subject: [PATCH] Fix typo in doc
---
lib/paperclip.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/paperclip.rb b/lib/paperclip.rb
diff --git a/vendor/plugins/admin_data/app/controllers/admin_data/main_controller.rb b/vendor/plugins/admin_data/app/controllers/admin_data/main_controller.rb
index 9aabf67..85a8516 100644
--- a/vendor/plugins/admin_data/app/controllers/admin_data/main_controller.rb
+++ b/vendor/plugins/admin_data/app/controllers/admin_data/main_controller.rb
@@ -70,7 +70,8 @@ class AdminData::MainController < AdminData::BaseController
def update
model_name_underscored = @klass.name.underscore
model_attrs = params[model_name_underscored]
- if @model.update_attributes(model_attrs)
+ @model.send(:attributes=, model_attrs, false)
# flo_template.rb
# inspired from http://github.com/jeremymcanally/rails-templates/blob/master/daring.rb
# reference for Rails template syntax: lib/rails_generator/generators/applications/app/template_runner.rb
# Delete unnecessary files
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm public/javascripts/*"
@Florent2
Florent2 / gist:349367
Created March 30, 2010 18:02
prepare iterm tabs for rails project
#!/usr/bin/env ruby
# a script to launch commands in differents iTerm tabs for a Rails project: console, server, mate...
# inspired by http://github.com/chrisjpowers/iterm_window examples
# examples:
# iterm-rails /path/to/project
# iterm-rails project # you can set a default project directory (see configuration options below)
# you can override default configuration options:
@Florent2
Florent2 / bundler-1.1-is-much-faster
Created August 26, 2011 23:24
Bundler 1.1 is much faster
in a newly created Rails 3.1.0.rc5 application:
$ time bundle _1.0.15_ install
Fetching source index for http://rubygems.org/
[...]
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
real 0m39.081s
user 0m34.663s
sys 0m0.632s
@Florent2
Florent2 / gist:1220951
Last active September 12, 2016 07:28
The technical books I've read
before { run "cd ~/code/rails_blank_app" }
run "echo -e \"\\033];rails_blank_app\\007\""
run "git st"
tab :name => "vim" do
run "echo -e \"\\033];vim\\007\""
run "vim ."
end
@Florent2
Florent2 / tddium_post_build.rake
Created September 12, 2012 16:56 — forked from semipermeable/tddium_post_build.rake
Tddium post-build task to deploy into Heroku
def run_cmd(cmd)
cmd_output = `#{cmd}`
if $?.to_i.zero?
true
else
puts cmd_output
false
end
end
- show ||= 'cards'
= div_for user, class: "user-#{show}" do
- if show == 'list'
.user-description
.user-avatar
= avatar(user, class: "user-img")
.user-info
= link_to user.name, "", class: "name"
%p.role= user.role_name