![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
rails
文章平均质量分 75
iteye_6945
这个作者很懒,什么都没留下…
展开
-
rails jquery and prototype
之前的项目用的是prototype ,许多功能是用prototype实现的现在项目要使用jquery,就必须混用也可以只用jqueryThere is a problem with using them together though: Prototype came up with this nice function called $() which is slightly...原创 2011-03-19 16:03:41 · 70 阅读 · 0 评论 -
Custom dialog for data-confirm in Rails
Every Rails developers might be already familiar with data-confirmattribute for a link. It is used to ask for user confirmation before executing the action on behalf of user. Here is one example ...原创 2016-10-11 17:24:24 · 342 阅读 · 0 评论 -
Rails系统重构:从单一复杂系统到多个小应用集群
转:http://www.infoq.com/cn/articles/rails-app-refactoring/ Ruby on Rails近几年在国内受到越来越多的开发者的青睐,Rails应用也从较简单的内部系统深入到复杂的企业级应用。Rails“习惯优于配置”的思想以及ActiveRecord等众多优秀的技术极大地提高了开发效率,但在业务复杂的大型系统中,Rails应用也会面临很多...原创 2016-11-17 22:32:57 · 180 阅读 · 0 评论 -
重构臃肿 ActiveRecord 模型的 7 种方式
转:http://ruby-china.org/topics/18418 当团队使用 Code Climate 来提高 Rails 程序的代码质量时,他们就会学习到如何防止模型慢慢变得臃肿。“胖模型( Fat models )” 在大应用中会导致维护问题。它仅仅比那种充斥着各种业务逻辑的凌乱的控制器好一点,但它们都违反了单一权责原则(SRP)。“任何有关用户做什么” 这种并不是单一权责。...原创 2016-11-19 16:29:06 · 186 阅读 · 0 评论 -
rails笔记
电子商务系统restful API问卷调查系统考试系统文档管理系统爬虫系统##############################################################>cd D:\mysql-5.7.15-win32\bin>mysqld -install>mysqld --initializestart mysql service:>n...原创 2016-11-28 13:55:43 · 447 阅读 · 0 评论 -
RESTful API 设计指南
转:http://www.ruanyifeng.com/blog/2014/05/restful_api.html 网络应用程序,分为前端和后端两个部分。当前的发展趋势,就是前端设备层出不穷(手机、平板、桌面电脑、其他专用设备......)。 因此,必须有一种统一的机制,方便不同的前端设备与后端进行通信。这导致API构架的流行,甚至出现"API First"的设计思想。RESTf...原创 2016-11-28 14:17:12 · 100 阅读 · 0 评论 -
7点关于RESTful规范的API接口设计的想法
转:https://segmentfault.com/a/1190000004051246 在项目中,需要为APP撰写API。刚开始接触的时候,并没有考虑太多,就想提供URL,APP端通过该URL进行查询、创建、更新等操作即可。但 再对相关规范进行了解后,才发现,API的设计并没有那么简单,远远不是URL的问题,而是一个通信协议的整体架构。因此,我写这篇文章,用来记录自己的 一些心得,...原创 2016-11-28 14:29:37 · 148 阅读 · 0 评论 -
Rails 3.2 的 Ajax 向导
原文: http://chloerei.com/2012/04/21/rails-3-2-ajax-guide/ Rails Ajax 的两种类型在 Rails 里面处理 Ajax 大致可以分为两种:UJS:服务端返回 Javascript,客户端收到后直接执行JSON API:服务端返回数据,客户端收到后本地处理再执行Rails 自带的 UJS 机制在提供少量 ...原创 2014-12-29 18:50:36 · 76 阅读 · 0 评论 -
rails render用法
render :action => "show_home_page", :layout=> false render :partial => "footer"render :template=> "templates" render :file => "#{RAILS_ROOT}/public/file.html"render :text =原创 2014-12-29 18:55:55 · 524 阅读 · 0 评论 -
Creating a 100% ajax CRUD using rails 3 and unobtrusive javascript
Creating the project and setting the GemfileEdited: Just corrected the misspelling on the title "unobtrusive", sorry for that** Ps: I'm using the latest rails 3 beta version while coding**$ ...原创 2014-12-29 22:29:37 · 99 阅读 · 0 评论 -
rails3 time zone
什么是Time Zone,就是时区,UTC或者是GMT UTC = Coordinated Universal Time. 中文名称为协调世界时 GMT = Greenwich Mean Time. 中文名称为格林尼治时 新建一个rails项目,默认是utc时间。 可以运行ActiveSupport::TimeZone.all.map(&:name...原创 2015-01-04 20:07:01 · 93 阅读 · 0 评论 -
常用ruby gem
常见gems:Devise用于快速构建用户功能,如:注册,登陆,个人设置,找回密码oauthOmniAuth如果你需要在项目中实现三方平台(如: Twitter, Facebook, 新浪微博, 腾讯 QQ)账号登陆的支持,那你需要用上它。will_paginate 和 Kaminari分页控件,几乎所有 Rails App 都在用, 其中 will_paginate 比较老, 应用案例较多,...原创 2016-10-01 12:34:05 · 750 阅读 · 0 评论 -
ror websites
http://railscasts.com/ http://railscasts-china.com/ http://rubyonrails.org/ http://ruby-china.org/原创 2014-03-04 11:29:17 · 73 阅读 · 0 评论 -
sphinx-0.99 + ultrasphinx
一、Installing Sphinx 1.Extract everything from the distribution tarball (haven't you already?) and go to the sphinx subdirectory: $ tar xzvf sphinx-0.9.9.tar.gz $ cd sphinx 2.Run the configuration prog...原创 2016-07-27 20:20:30 · 84 阅读 · 0 评论 -
用Rails3和jQuery创建一个100% ajax CRUD应用
Changing from Prototype to JqueryFor default Rails implements ajax requests with prototype, we need to change it to work with jquery.First, download the rails.js equivalent with jquery from gi...原创 2011-03-19 16:05:55 · 92 阅读 · 0 评论 -
Rails3:使用bundler管理gems
直接在命令行(CMD)执行:sudo gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n(以上是一行,一次输入并执行) bundle install 时有一个gem出错 下面的gem就不会被安装[sim...原创 2011-03-19 16:07:21 · 83 阅读 · 0 评论 -
set up RVM with rails2 and rails3
1 - Installing RVM $ sudo gem install rvm $ (rvm-install已过时) $ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) Finally put this lines in your .bash_profile or .bashrc:...原创 2011-03-19 16:15:19 · 91 阅读 · 0 评论 -
validation
http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.htmlclass Comment include ActiveModel::Validations validate :must_be_friends def must_be_friends errors.add(:bas...原创 2011-03-19 18:09:58 · 131 阅读 · 0 评论 -
fragment cache
1.hold the current frament in a variable while new a note , when "cancel" clicked,replace it back.2.load the new note form when load the page , place it in a hidden div .when new a note ,strai...原创 2011-03-30 01:30:39 · 106 阅读 · 0 评论 -
搭建rails开发环境
http://www.netbeans.org/ NetBeans IDE 下载包所支持的技术* Java SE JavaFX Java Ruby C/C++ PHP AllJava SE用于 Java 编程的基本工具,其中包括编辑器、调试器、Profiler、重构支持以及屡获殊荣的拖放式 GUI 设计工具(以前称为 Project Mat...原创 2011-04-08 19:35:58 · 92 阅读 · 0 评论 -
rails env
1.apt-get安装ruby:~$ sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev build-essentialtongxiaoming520@tongxiaoming520-laptop:/usr/bin$ ls -a | grep ruby 查...原创 2011-04-08 19:41:08 · 134 阅读 · 0 评论 -
识别验证码
用imagemagick和tesseract-ocr破解简单验证码 Tesseract是Ray Smith 于1985到1995年间在惠普布里斯托实验室开发的一个OCR引擎,曾经在1995 UNLV精确度测试中名列前茅。但1996年后基本停止了开发。2006年,Google邀请Smith加盟,重启该项目。目前项目的许可证是Apache 2.0。 该项目目前支持Windows...原创 2011-11-18 17:20:03 · 130 阅读 · 0 评论 -
OAuth gem for rails3
OAuth gem for rails,支持豆瓣,新浪微薄,腾讯微博,搜狐微博,网易微博 http://www.haogongju.net/art/115920 OAuth是由Blaine Cook、Chris Messina、Larry Halff 及David Recordon共同发起的,目的在于为API访问授权提供一个开放的标准。 oauth目前看...原创 2012-05-21 23:24:16 · 87 阅读 · 0 评论 -
rails3 simple captcha
安装:ruby script/plugin install git://github.com/kares/simple_captcha.git 安装之后,跟随下面的步骤配置插件:#### STEP 1rails generate simple_captcha#### STEP 2rake db:migrate#### STEP 3 将下面的代码添加到 conf...原创 2015-06-03 16:06:29 · 140 阅读 · 0 评论 -
测试ruby代码高亮
# encoding: utf-8require 'digest/sha2'class User < ActiveRecord::Base validates :email, format: {with: /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, message: '请填写有效电子邮箱'}, :on => :crea...原创 2015-05-27 16:33:33 · 371 阅读 · 0 评论