- Efficient Rails, Andrew Allen
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
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 |
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
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) |
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
# 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/*" |
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
#!/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: |
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
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 |
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
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 |
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 run_cmd(cmd) | |
cmd_output = `#{cmd}` | |
if $?.to_i.zero? | |
true | |
else | |
puts cmd_output | |
false | |
end | |
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
- 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 |
OlderNewer