    # File lib/merb-core/dispatch/router/resources.rb, line 227
          def resource(name, *args, &block)
            name    = name.to_s
            options = extract_options_from_args!(args) || {}
            params  = { :controller => options.delete(:controller) || name.pluralize }
            member  = { :new => :get, :edit => :get, :delete => :get }.merge(options.delete(:member) || {})

            options[:name_prefix]       ||= nil # Don't use a name_prefix if not needed
            options[:resource_prefix]   ||= nil # Don't use a resource_prefix if not needed
            options[:controller_prefix] ||= options.delete(:namespace)

            self.namespace(name, options).to(params) do |resource|
              # => show

              resource.match("(.:format)", :method => :get).to(:action => "show").
                name(name).register_resource(name)

              # => create
              resource.match("(.:format)", :method => :post).to(:action => "create")

              # => update
              resource.match("(.:format)", :method => :put).to(:action => "update")

              # => destroy
              resource.match("(.:format)", :method => :delete).to(:action => "destroy")

              member.each_pair do |action, method|
                action = action.to_s
                resource.match("/#{action}(.:format)", :method => method).to(:action => action).
                  name(action, name).register_resource(name, action)
              end

              if block_given?
                builders = {}

                builders[:member] = lambda do |action, to, method|
                  resource.match("/#{action}(.:format)", :method => method).to(:action => to).
                    name(action, name).register_resource(name, action)
                end

                resource.options(:name_prefix => name, :resource_prefix => name).
                  resource_block(builders, &block)
              end
            end
          end