- 浏览: 77179 次
- 性别:
- 来自: 地球
最近访客 更多访客>>
最新评论
-
zhou1986lin:
[flash=200,200][b]引用[size=x-sma ...
新浪编辑器 -
vb2005xu:
晕 想不出来 为什么要实现 什么什么语言的 版本的好处
不都是 ...
新浪编辑器 -
minma_yuyang:
还不错,借鉴了。
Code style -
天机老人:
谢谢啊,这文章不错!
Sphinx -
suncanoe:
<iframe id="myEditor&qu ...
新浪编辑器
文章列表
1. Describe block
describe "describes" do
before(:each) do
this will execute every time
end
it “it describes” do
should
should_not
end
end
2. Should and should_not method
receiver.should(matcher) # the simplest example
# Passes if matcher.matches ...
- 2009-05-14 11:04
- 浏览 717
- 评论(0)
1.Need to install gem: rspec, rspec-rails,
plugin: machinist(to create fake records for test)
rspec-on-rails-matchers(provide method: belong_to has_many for model test)
2.Need to install gem: faker, and write bluepoints.rb in spec directory,like follow
require 'faker'
Sham.name { Faker::Nam ...
- 2009-05-14 11:03
- 浏览 714
- 评论(0)
1. Use underline to Separate different part of Variable and method's name.
project_item
@product_name
def find_people
end
2.We should have a space after comma, no space before comma and no space in method parentheses.
attr_reader :product, :quantity
find_product(name, id, time)
3.Javascript
win ...
- 2009-05-14 11:03
- 浏览 829
- 评论(0)
1. Two spaces indentation
2. Comments
New:
# The comment
Old:
# The comment
3. Whitespace should be used to split up the code, not random
4. Lining up and spacing
4.a spaces between variables and equals
4.b lining up
New:
@task_data = WorkItem.find_by_sql(str_task)
@project_data = W ...
- 2009-05-14 11:02
- 浏览 802
- 评论(0)
Developer Review¶
Part to copy for push to Dev QA
Migrations (No duplicate numbers, class names) -
Code Indentation and Style (2 spaces + formatted) -
Naming (meaningfull method names, ! ?) -
Structure and Length (no long methods, light controllers, repeated code)-
Javascript Checks (JSLint, Globa ...
- 2009-05-14 11:00
- 浏览 1054
- 评论(1)
在配置environment中加入
Ultrasphinx::Search.excerpting_options =
HashWithIndifferentAccess.new({
:before_match => '<span style="font-weight:bold;color:red">',
:after_match => '</span>',
:chunk_separator => "...",
:limit => 256,
#s:around => 2, # This doesn't s ...
- 2008-12-16 14:25
- 浏览 2786
- 评论(0)
Ruby on Rails 2.2 发行笔记
1. Infrastructure
Rails 2.2 is a significant release for the infrastructure that keeps Rails humming along and connected to the rest of the world.
1.1. Internationalization国际化
Rails 2.2 supplies an easy system for internationalization (or i18n, for those of you tired of typing ...
- 2008-11-24 15:45
- 浏览 1482
- 评论(0)
从文本字段读取数据
输入视图:
<form action = "\look\at">
...
<input type="text" name="text1">
...
</form>
动作:
def at
@date = params[:text1]
end
输出视图:
<br>
Your Name is <% = @date %>
</br>
从复选框读取数据
输入视图:
<form action = "\look\at"&g ...
- 2008-11-16 16:37
- 浏览 1920
- 评论(0)
1.表单类型一
<div class=""class="form">
<%= error_messages_for 'user' %>
<fieldset>
<legend>请输入用户信息</legend>
<% form_for :user do |form| %>
<p>
Name: <%= form.text_field :username, :siz ...
- 2008-11-14 09:36
- 浏览 1373
- 评论(0)
首先,在ubuntu下要安装
atp-get install build-essential zlib1g-dev
ruby需要安装dev包
1、安装ferret
sudo gem install ferret
2、安装acts_as_ferret
可用gem
sudo gem install acts_as_ferret
或用plugins
svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret
个人建议用gem稳点
到此安装结束
在model中添加
acts_as_ferret ...
- 2008-11-13 18:58
- 浏览 1528
- 评论(0)
在线编辑器是web应用中最常见的东西了,关于它的作用和意义我不想多说什么了。对于编辑器的使用,之前就是随便找个简单的HTML编辑器甚至是 textarea来应付,也没花多少时间来整这个东西,但事情开始逐渐变得麻烦起来,因为我们的客户(可能就是你的老板)的要求越来越高:能不能加上点丰富的表情?能不能使编辑器再多支持几种格式排版?或许有一天客户看到了搜狐的编辑器,回来说能不能让我们的编辑器也增加本地图片上传?最好再要加个附件功能,并且也要从本地上传 …………,这一切让我以前做的小编辑器显得无地自容,也忒简陋了吧。于是我很自然地想到了rails里面最常用的FCK编辑器,的确,它基本可以满足我的所有需要 ...
- 2008-11-13 15:30
- 浏览 3592
- 评论(3)
robbin以前曾经在JavaEye介绍过Sphinx这个性能优异的全文检索引擎:
http://www.iteye.com/topic/122696
当时Sphinx还不支持中文分词,现在情况已经完全改变了。李沫南为Sphinx开发了中文分词的插件——libmmseg。对于libmmseg,robbin以前也有介绍,不过是用在Ferret里面。
http://www.iteye.com/topic/196451
李沫南还开发了一个支持中文全文检索的Sphinx定制版本——Coreseek,除了支持中文的全文检索外,Coreseek最大的特点是支持使用Python提供自定义的数据源。我们可以 ...
- 2008-11-13 15:26
- 浏览 3226
- 评论(1)
Step 1: As usual, the first thing we'll want to do is make sure your version of Hardy Heron 8.04 is up to date.:
sudo apt-get update
sudo apt-get dist-upgrade
Step 2: We'll be installing some software that needs to be built so we'll need to get packages required for compiling. In one swoop, you can ...
- 2008-10-30 22:08
- 浏览 808
- 评论(0)
http://www.urbanpuddle.com/articles/2008/04/28/install-ruby-on-rails-hardy-heron
http://guides.rails.info/
http://api.rubyonrails.org/
http://www.opensourcerails.com/
http://railscasts.com/
http://agilewebdevelopment.com/
http://www.tutorialspoint.com/ruby-on-rails/
http://www.all-open.com/ror/ror_CM ...
- 2008-10-30 21:37
- 浏览 952
- 评论(0)