`
yang_kunlun
  • 浏览: 77179 次
  • 性别: Icon_minigender_1
  • 来自: 地球
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表

Outline of Rspec

    博客分类:
  • Test
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 ...

Rspec on rails

    博客分类:
  • Test
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 ...
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 ...
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 ...
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 ...
在配置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 ...
beast、rforum、mephisto、typo
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 ...

Rails view

    博客分类:
  • ROR
从文本字段读取数据 输入视图: <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 ...

Rails 表单

    博客分类:
  • ROR
1.表单类型一 <div class=""class="form">         <%= error_messages_for 'user' %>         <fieldset>           <legend>请输入用户信息</legend>        <% form_for :user do |form| %>           <p>             Name: <%= form.text_field :username, :siz ...
首先,在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 ...
在线编辑器是web应用中最常见的东西了,关于它的作用和意义我不想多说什么了。对于编辑器的使用,之前就是随便找个简单的HTML编辑器甚至是 textarea来应付,也没花多少时间来整这个东西,但事情开始逐渐变得麻烦起来,因为我们的客户(可能就是你的老板)的要求越来越高:能不能加上点丰富的表情?能不能使编辑器再多支持几种格式排版?或许有一天客户看到了搜狐的编辑器,回来说能不能让我们的编辑器也增加本地图片上传?最好再要加个附件功能,并且也要从本地上传 …………,这一切让我以前做的小编辑器显得无地自容,也忒简陋了吧。于是我很自然地想到了rails里面最常用的FCK编辑器,的确,它基本可以满足我的所有需要 ...
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提供自定义的数据源。我们可以 ...
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 ...
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 ...
Global site tag (gtag.js) - Google Analytics