- 博客(74)
- 资源 (2)
- 收藏
- 关注
原创 打造菜鸟的ubuntu rails 开发环境
@install gcc apt-get install build-essential@install ruby 1.sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev 2.go to rubyforge download rubygems0.9.5
2008-05-01 09:54:00
572
转载 linux下载工具
<!-- @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm } --> http://blog.chinaunix.net/u/12110/showart_76769.htmlWindows中有很多下载工具,如耳熟能详的FlashGet, NetAnt等。随着L
2008-05-01 09:52:00
5401
原创 学习webservice
转http://web.chinaitlab.com/web/728879.html什么是webservice?webservice有人称之为web服务,其实都是一回事。这几年由IBM公司提出的SOA的概念被炒作的大红大紫的。主要就是因为这种webservice的技术。 这是一种通过HTTP协议,以web应用服务器为依托,利用XML平台做交互的方式,实现跨平台的功能。这说的太抽象了,通俗一
2008-04-02 21:47:00
386
原创 给rails装上fckeditor插件
1.到rubyforge.org下载fckeditor plugin,我现在是0.4.32.解压到vendor下,改名为fckeditor3.到项目根目录,根据readme:rake fckeditor:install 4.在要用到的页面,添上 javascript_include_tag :fckeditor %>5.改textarea为 Simple, :width =>
2008-02-17 16:50:00
382
原创 mysql basic sql
show databases;use onedatabase;show tables;show columns from atable;create databases if not exists fruit;create table fruits(name char(20),color char(20)); select * from table_
2008-02-15 20:48:00
281
原创 windows上安装rmagick
令人吐血:1.解压到临时文件夹2.安装exe,按默认路径3.将安装路径写入系统path里,否则会提示找不到core RL magick.dll4.cd 临时文件夹,gem install rmagick5. 重新启动,否则不起作用,irb里 require rmagick无法load,可是重启后也不起作用?
2008-02-15 20:44:00
328
原创 rails deployment
from robbins javaeye blog: http://www.javaeye.com/topic/155542:from Al Andersons VTC RubyOnRails:
2008-02-14 21:20:00
302
原创 rails CSS/XSS——cross-site scripting
if you use h(),it will be:otherwise: it wont be shown:also:otherwise:it functioned:
2008-02-14 20:02:00
337
原创 rails SQL injection
it list all the movies in the databases: good sql:the same search result is null:lets go to see the log,the original sql is :原来sql where like 用法:如:查询name字段中包含有“明”字的。
2008-02-14 19:23:00
324
原创 rails test——model/controller test
1.model test——unit test rake db:test:prepare 准备test数据库,赋值dev的数据库结构 give the test data in the test fixtures: such as critics.yml then go to the unit tests file to write the tes
2008-02-14 16:50:00
386
原创 rails link_to
link_to(name, options = {}, html_options = nil) Creates a link tag of the given name using a URL created by the set of options. See the valid options in the documentation for url_for. It‘s al
2008-02-14 15:07:00
1849
原创 rails file_field/form_for
see the api:file_field(object_name, method, options = {}) Returns an file upload input tag tailored for accessing a specified attribute (identified by method) on an object assigned to the te
2008-02-14 14:50:00
1888
原创 rails date/time field/radio_button/check_box
here in the database: if checked,the value is 1they api can be found at ActionView::Helpers::FormHelper
2008-02-14 14:01:00
491
原创 rails text_field_tag/password_field_tag/text_area_tag
VS text_field/password_field/text_area
2008-02-14 13:21:00
522
原创 rails text_field/text_area/hidden_field/password_field
1.text_field ------------------------- ActionView::Helpers::FormHelper#text_fieldtext_field(object_name, method, options = {})--------------------------------------------------------------------Retu
2008-02-14 12:52:00
2081
原创 rails helper
comment_helper.rblayouts-----comment.rhtmlcomment_controller.rbthe view:
2008-02-13 16:56:00
334
转载 http session/cookie
from http://hmily.blueidea.com/archives/2007/4508.shtml 介绍一篇关于session的好文章,写的很详细HmilyHeart 发表于 2007-3-24 14:41:00
2008-02-13 15:40:00
344
原创 rails sessions
what is session:from http://wiki.ccw.com.cn/Session当一个访问者来到你的网站的时候一个Session就开始了,当他离开的时候Session就结束了。本质是来说,cookie是和浏览器有关系,而Session变量就可以存一些资源变量在服务器上面。 session vs cookiefrom http://ks.cn.yahoo.com
2008-02-13 15:31:00
427
原创 rails cookies
what is cookie:from http://wiki.ccw.com.cn/CookieCookie有时也用其复数形式Cookies,指某些网站为了辨别用户身份而储存在用户本地终端上的数据(通常经过加密)。定义于RFC2109。它是网景公司的前雇员Lou Montulli在1993年3月的发明。 用途 服务器可以利用Cookies包含信息的任意性来筛选并经常性维护这些
2008-02-13 15:09:00
1125
原创 rails routes/generate your own url/add a controller
if you when to add controller in the link_to like this ,it will error: so how to do that,you can generate url: it will be useful when you store the url in the database.
2008-02-13 14:01:00
289
原创 rails scaffold
scaffold model_name controller_namelist.rhtmlh1>Listing moviesh1>table> tr> % for column in Movie.content_columns %> th>%= column.human_name %>th> % end %> tr> % for movie in @movies
2008-02-13 12:56:00
700
原创 rails ActiveRecord find/count
find/find_by_attributesName/find_all_by_attributesName/find(:first,:conditions=>)/find(:first,:conditions=>)/count find(*args) Find operates with three different retrieval approaches: Find by
2008-02-13 10:41:00
997
原创 rails model relationship
1.one-to-one 一对一的相互访问order.invoice=invoiceinvoice.order.company2.one-to-many: each others communication:a_critic.commentsa_comment.critic.lastname如何通过a_critic访问某个co
2008-02-12 23:26:00
318
转载 rails set_primary_key
from zusocfc.blogspot.com/2006/08/setprimarykey.htmlset_primary_key 在Rails,如果你想要使用自訂的Primary Key Name(主鍵)的話(如果你用Migrate產生,預設就會建立一個叫作id的主鍵)可以使用set_primary_key在Rails,如果你想要使用自订的Primary Key Name(主
2008-02-12 22:17:00
898
原创 rails created_at/updated_at timestamp
it only autofilled when its saved,but not created:
2008-02-12 22:08:00
564
原创 rails ActiveRecord
go to rails api: http://api.rubyonrails.org/go to ActiveRecord::Basesee method find/new/savefind(*args) Find operates with three different retrieval approaches: Find by id: This can either
2008-02-12 21:51:00
936
原创 ruby script/generate controller/model/mailer/scaffold
What can you generate ? generate controller: It can generate the corresponding views of the actions.generate mailer:生成的model如下:Class Notificationsclass Notifications ActionMa
2008-02-12 13:31:00
431
原创 ruby script command
open the script folder, we can find what the rails scripts are:To see how to use them,just type ruby script/about[breakpoiner/cosole/destroy...]also you can use this to know how to use des
2008-02-12 13:21:00
366
原创 upgrade current rorapps
rails .搞定,由1.2.5升到1.2.6使用最新版的railsrake freeze_edge将最新版的rails下载到项目的vendor下。
2008-02-12 10:44:00
246
原创 ruby net programming
1.net/httprequire "net/http"begin h= Net::HTTP.new("google.cn",80) resp, data =h.get("/index",nil)rescue => err puts "Error: #{err}" exitendputs "We recevied #{data.split.size} lines and #{d
2008-02-11 20:09:00
941
原创 ruby test/debug
1.from system test to unit test 2.write unit testClass Personclass Person attr_reader :name,:age,:year_born def initialize(name,age) @name=name @age=age @year_born=(Time.now
2008-02-11 19:32:00
403
原创 ruby system call
n=ARGV.sizeputs "I was given #{n} arguments when I was called."puts "The arguments were:"ARGV.each do |arg| puts argend 1.linux: system("echo","hello from the system")puts("hello fr
2008-02-11 17:42:00
2846
原创 ruby thread
Class Printerclass Printer attr_reader :count def initialize @count=0 end def print(caller) puts "#{caller}: #{@count}" @count+=1 end end p1=Printer.newt2=Thread.new{100
2008-02-11 15:36:00
359
原创 ruby advanced datastructure--set/stacks/queues
set 关于set的操作:-------------------------------------------------------- Set#&&(Enum )enum)--------------------------------------------------------------Returns a new set containing elements
2008-02-11 14:20:00
357
原创 ruby Hash
1. Array是一种特殊的Hash,Array的索引恰为它的键 2.Array和Hash的创建对比:摘自《the ruby way》 8.1.1. Creating and Initializing an ArrayThe special Class methodclass method [] is used to create an array; the data
2008-02-11 13:16:00
1722
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人