- 浏览: 166984 次
- 性别:
- 来自: 上海
最新评论
-
tangyuanjian:
这个request怎么赋值啊!
rails技巧之得到web应用中的web服务器地址和端口号 -
wangbaocai:
asp.net导出邮箱联系人列表,支持QQ邮箱、163邮箱、G ...
rails 导出邮箱联系人 -
andrew.yulong:
他默认有个guest角色啊
rails 权限控制 -
liucuan:
如果想过滤这个插件怎么过滤,比如我的index页面我想登录不登 ...
rails 权限控制 -
ayaga:
pt.afterTextEl.el.innerHTML = S ...
extJS控件之每页显示N条记录
文章列表
http://l4cd.net/blog/post-old-11.html
< ?xml version="1.0" encoding="utf-8"?>
<mx :Application
xmlns:mx="http://www.adobe.com/2006/mxml"
viewSourceURL="src/HandlingEventsActionScript/index.html"
horizontalAlign="center" verticalAlign="middle"
width="300 ...
网页中常用到的效果...
图片不存在时转向默认图片..
网页中一般有两种方法..服务器重定义或用js重定向...
在flex/flash中也可以用相应的方法.. 侦听ioError事件..然后指定默认的图片地址..
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script ...
安装地址:git clone git://github.com/stffn/declarative_authorization.git vendor/plugins/declarative_authorization
这里不在svn上面,需要安装git(自己google)
1.在user模型是上加roles字段,该字段存储权限
2.打开application_controller,添加
before_filt ...
script/plugin install http://svn.pullmonkey.com/plugins/trunk/open_flash_chart/
Move the open_flash_chart.swf file into your RAILS_ROOT/public directory
Move the swfobject.js file into your RAILS_ROOT/public/javascripts directory
首先执行以上三步
接下来? 很简单 查看http://pullmonkey.com/projects/open_fla ...
/**
* 在光标的位置插入图片
* @param {Object} myField
* @param {Object} myValue
*/
function AddOnPos(myField, myValue)
{
//IE support
if (document.selection)
{
myField.focus();
sel = document.selection.createRange();
myValue = "[face]"+myValue+"[/face]";
sel.text = my ...
JPEGCam在线摄像头捕获图片
下载地址http://code.google.com/p/jpegcam/downloads/list
里面的文档说明很详细,这里要说明的是,该项目服务器端用的php,如果我们后台用rails的话,在action里面要获得表单传来的图片流文件,需要用到方法request.raw_post
def set_photo
File.open("#{RAILS_ROOT}/public/"+"/1.jpg", "wb") do |f|
f.write(re ...
1. render :action => "long_goal", :layout => "spectacular"
2. render :partial => "person", :locals => { :name => "david" }
3. render :template => "weblog/show", :locals => {:customer => Customer.new}
4. render :file ...
第一步安装gem
gem install json
gem install contactlist-client
在rb里写
require 'contactlist-client'
require 'json'
contacts = ContactList::Client.fetch(account, password, type)
contacts.each do |contact|
puts "username: #{contact.username}, email: #{contact.email}"
end
ac ...
1. 在application_helper.r中定义will_paginate_remote helper:
def will_paginate_remote(paginator, options={})
update = options.delete(:update)
url = options.delete(:url)
params = options.delete(:params)
str = will_paginate(paginator, options)
if str != nil
str.gsub(/href="(.*?)&qu ...
本来下用Rmagick,搞了半天也没出来,总是报错,我想Rmagick是跟我无缘吧,于是换了mini_magick,好像这个还好点,没有内存泄漏的问题。 这个和Rmagick一样,需要安装ImageMagick,我安装的是ImageMagick-6.3.9-Q16 首先安装gem,我在家安装了一个晚上,报了一晚上的超时,在公司几分钟就好了,无比郁闷
gem install mini_magick
第一个例子
class Demo
require 'mini_magick'
img = MiniMagick::Im ...
什么都不说了,直接进入正题.
插件安装地址:http://ibatis.apache.org/tools/abator
里面有name和url,填了就可以安装了.
通过菜单的 File > New > Abator for iBatis Configuration File
可以生成abatorConfig.xml的框架,通过修改其中的内容可以定制生成的规则和数据库链接信息
配置文件编辑完成之后右键选择abatorConfig.xml文件,选择Generate iBatis Artifacts生成代码框架。
具体配置文件如下
<?xml version=
- 2008-09-28 10:48
- 浏览 2575
- 评论(0)
URL为 http://192.168.1.1:8080/resources/电话.xls如果使用 URLEncoder.encode 将会把冒号等一块给替换了http%3A%2F%2F192.168.1.1%3A8080%2Fresources%2F%E7%94%B5%E8%AF%9D.xls这并不是我们需要的,我们只希望替换编码里面中文的部分,这里给出了解决方法,很简单
package log;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.regex. ...
- 2008-09-17 10:10
- 浏览 1759
- 评论(0)
想打开一个下拉框,里面是一个树吗?
嘿嘿,就像这样.
代码其实很简单的.
var comboxWithTree = new Ext.form.ComboBox({
store:new Ext.data.SimpleStore({fields:[],data:[[]]}),
editable:false,
shadow:false,
mode: 'local',
triggerAction:'all',
maxHeight: 200,
tpl: '<tpl for="."><div style="he ...
看来javascript王者归来,写点读书心得。
在js的海洋中,有四种生物存在,他们分别是私有属性(定义在类的内部,外部只能通过getter/setter方法读取),动态共有属性(外部可以随意读取),静态属性(也就是类属性,只能通过类访问),原型属性。
要想知道这4种属性的区别,看看下面的代码就知道。
上面的代码写的很清楚了,这里说明一下delete方法,delete可以删除对象的某个属性。