ruby in rails
lissanwen
这个作者很懒,什么都没留下…
展开
-
HTML::Selector #select #match
[b]match(element, first?) => array or nil[/b] Matches an element against the selector. For a simple selector this method returns an array with the element if the element matches, nil otherwise. ...2010-03-25 11:37:07 · 110 阅读 · 0 评论 -
Base# filter_parameter_logging
# Replace sensitive parameter data from the request log. # Filters parameters that have any of the arguments as a substring. # Looks in all subhashes of the param hash for keys to filter...2010-03-26 20:41:39 · 109 阅读 · 0 评论 -
Rails url_for and params missery
Assume you have a params array with the following items: [code="java"]params[:qry][:name] = ‘jo’ params[:qry][:city] = ”[/code] You would like to build a new URL with the current params appen...2010-04-02 12:59:36 · 115 阅读 · 0 评论 -
#error_messages_for(*params)
# Returns a string with a DIV containing all of the error messages for the objects located as instance variables by the names # given. If more than one object is specified, the errors for th...2010-04-07 11:54:47 · 122 阅读 · 0 评论 -
Uploading multiple images with Rails and Paperclip
[url]http://infrastacks.com/?p=57[/url] [code="java"] 'photo', :collection => @album.photos %> 'photo', :object => Photo.new end %>[/code] The “Add Photo” function lets us dynamically ...2010-04-23 17:03:03 · 92 阅读 · 0 评论 -
ostruct.rb caller
# # = ostruct.rb: OpenStruct implementation # # Author:: Yukihiro Matsumoto # Documentation:: Gavin Sinclair # # OpenStruct allows the creation of data objects with arbitrary attributes. # See ...原创 2011-01-04 15:57:15 · 105 阅读 · 0 评论 -
minitest
require 'minitest/spec' MiniTest::Unit.autorun describe MiniTest::Spec do before do @assertion_count = 4 end after do self._assertions.must_equal @assertion_count end ...原创 2011-05-20 10:21:41 · 197 阅读 · 0 评论 -
nokogiri
227 class Builder 228 # The current Document object being built 229 attr_accessor :doc 230 231 # The parent of the current node being built 232 attr_accessor :parent ...原创 2011-08-29 13:57:39 · 83 阅读 · 0 评论 -
Log
[code="java"]class BasicLog # log-level constant FATAL, ERROR, WARN, INFO, DEBUG = 1, 2, 3, 4, 5 attr_accessor :level def initialize(log_file=nil, level=nil) @level = le...原创 2010-11-26 16:55:53 · 92 阅读 · 0 评论