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 use | |
@configuration ||= {} | |
yield @configuration | |
nil | |
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
irb(main):094:0> @dfd.is_a?(User) | |
=> true | |
irb(main):095:0> @dfd.is_tagger? | |
=> true | |
irb(main):096:0> @alink = { :name => 'google', :link => 'http://google.com', :description => '', :tag_list => 'hello' } | |
=> {:name=>"google", :link=>"http://google.com", :description=>"", :tag_list=>"hello"} | |
irb(main):097:0> new_link = @dfd.links.new(@alink) | |
=> #<Link id: nil, name: "google", description: "", link: "http://google.com", created_at: nil, updated_at: nil, user_id: 1> | |
irb(main):098:0> new_link.tag_list | |
=> [] |
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
links-tag-test $ bundle exec rails console | |
Loading development environment (Rails 3.0.1) | |
irb(main):001:0> @link1 = Link.create(:name => 'google', :link => 'http://google.com', :description => 'google', :tag_list => 'tag1, tag2, tag3') | |
=> #<Link id: 12, name: "google", description: "google", link: "http://google.com", created_at: "2010-11-23 18:09:37", updated_at: "2010-11-23 18:09:37", user_id: nil> | |
irb(main):002:0> @link1.is_taggable? | |
=> true | |
irb(main):003:0> @link1.tag_list | |
=> [] | |
irb(main):004:0> @link2 = Link.new(:name => 'yahoo', :link => 'http://yahoo.com', :description => 'yahoo') | |
=> #<Link id: nil, name: "yahoo", description: "yahoo", link: "http://yahoo.com", created_at: nil, updated_at: nil, user_id: nil> |
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
#### Rails console #### | |
irb(main):091:0> @doc.tag_list | |
=> [] | |
irb(main):092:0> @doc.tag_list = "one, two, three" | |
=> "one, two, three" | |
irb(main):093:0> @doc.save! | |
=> true | |
irb(main):094:0> @doc.tag_list | |
=> [] | |
irb(main):095:0> ActsAsTaggableOn::Tag.named("one") |
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
# UTF-8 value on page: | |
"Adélaïde de Hongrie" | |
# GET string: | |
Started GET "/registers/results?filter[title][]=Ad%E9la%EFde%20de%20Hongrie&search=&limit=4" for 127.0.0.1 at 2011-05-16 14:17:33 +0700 | |
# What Rails gets/Rack produces (in Controller): |
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
/Library/WebServer/Deployment/miximize:$ be bin/rails s | |
DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from require at /opt/local/lib/ruby1.9/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68) | |
DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2. (called from require at /opt/local/lib/ruby1.9/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:68) | |
=> Booting WEBrick | |
=> Rails 3.1.0.rc5 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Library/WebServer/Deployment/miximize/vendor/ruby/1.9.1/gems/devise-1.1.7/lib/devise/mapping.rb:40:in `find_scope!': Could not find a valid mapping for #<User:0x000001033354b0> (RuntimeError) | |
from /Library/WebServer/Deployment/miximize/vendor/ruby/1.9.1/gems/devise-1.1.7/app/mailers/devise/mailer.rb:21:in `setup_mail' |
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 plugin_dir/lib/plugin_name.rb | |
... | |
%w{ models controllers }.each do |dir| | |
path = File.join(File.dirname(__FILE__), 'app', dir) | |
$LOAD_PATH << path | |
# it would be nice if someone updated the documentation. | |
ActiveSupport::Dependencies.autoload_paths << path | |
ActiveSupport::Dependencies.autoload_once_paths.delete(path) | |
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
module Thinger | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def acts_as_something | |
class_eval do | |
has_many :assignments | |
has_many :things, :through => :assignments | |
attr_accessible :things |
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
(map | |
#(clojure.string/replace (clojure.string/replace (.getPath %1) #"resources/assets/" "") #"/./" "/") | |
files)) |
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
nREPL server started on port 60277 | |
REPL-y 0.1.10 | |
Clojure 1.5.1 | |
Exit: Control+D or (exit) or (quit) | |
Commands: (user/help) | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") | |
Source: (source function-name-here) | |
(user/sourcery function-name-here) | |
Javadoc: (javadoc java-object-or-class-here) |
OlderNewer