一直使用 TextMate 的飘过
还真没关注过项目依赖的数量,不过看了下自己写的东西,随便个项目,飙升到几十个好像很容易
discuz 的插件一开就是全站开的,不是针对某用户的呀 :)
最后把控制器改成这样了:
def index
@topics = Topic.includes(:user).page(params[:page]).reverse_order.all
fresh_when(:etag => [@topics])
end
@topics = Topic.includes(:user).page(1).reverse_order
Digest::MD5.hexdigest(@topics)
报告错误:TypeError: can't convert ActiveRecord::Relation into String
Started GET "/topics" for 127.0.0.1 at 2013-01-11 15:07:51 +0800
Processing by TopicsController#index as HTML
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Rendered topics/_form.html.erb (3.7ms)
Topic Load (0.1ms) SELECT "topics".* FROM "topics" ORDER BY "topics"."id" DESC LIMIT 30 OFFSET 0
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" IN (1)
(0.1ms) SELECT COUNT(*) FROM "comments" WHERE "comments"."topic_id" = 1
(0.1ms) SELECT COUNT(*) FROM "flowers" WHERE "flowers"."topic_id" = 1
Rendered topics/_topic.html.erb (4.3ms)
Rendered topics/index.html.erb within layouts/topics (11.9ms)
User Load (0.2ms) SELECT "users".* FROM "users" LIMIT 10
Rendered users/_user.html.erb (1.0ms)
Rendered layouts/application.html.erb (3.7ms)
Completed 200 OK in 22ms (Views: 19.8ms | ActiveRecord: 1.0ms)
Started GET "/assets/application.css" for 127.0.0.1 at 2013-01-11 15:07:51 +0800
Served asset /application.css - 304 Not Modified (4ms)
Started GET "/assets/application.js" for 127.0.0.1 at 2013-01-11 15:07:51 +0800
Served asset /application.js - 304 Not Modified (2ms)
Started GET "/topics" for 127.0.0.1 at 2013-01-11 15:07:52 +0800
Processing by TopicsController#index as HTML
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Rendered topics/_form.html.erb (3.8ms)
Topic Load (0.2ms) SELECT "topics".* FROM "topics" ORDER BY "topics"."id" DESC LIMIT 30 OFFSET 0
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" IN (1)
(0.1ms) SELECT COUNT(*) FROM "comments" WHERE "comments"."topic_id" = 1
(0.1ms) SELECT COUNT(*) FROM "flowers" WHERE "flowers"."topic_id" = 1
Rendered topics/_topic.html.erb (4.5ms)
Rendered topics/index.html.erb within layouts/topics (12.3ms)
User Load (0.1ms) SELECT "users".* FROM "users" LIMIT 10
Rendered users/_user.html.erb (1.1ms)
Rendered layouts/application.html.erb (3.0ms)
Completed 200 OK in 22ms (Views: 19.6ms | ActiveRecord: 1.0ms)
Started GET "/assets/application.css" for 127.0.0.1 at 2013-01-11 15:07:52 +0800
Served asset /application.css - 304 Not Modified (4ms)
Started GET "/assets/application.js" for 127.0.0.1 at 2013-01-11 15:07:52 +0800
Served asset /application.js - 304 Not Modified (2ms)
#6 楼 @woaigithub 呵呵,呵呵,理解,理解
Model 没有被调用之前不显示……
个人建议把全文全贴出来就可以了,没必要非让人到你的 BLOG 上看……
yum install mysql-devel
分析的挺牛 B。。。。。。
更简便的办法就是看看有没有谁写好的现成的 gem 或者 view 了:) 我也很期待很简单的办法……
rails g devise:view
然后嗷嗷改 HTML
我悲催了,手贱,没看清文档,在新建应用的时候把邀请码输入到“输入邀请码,抢先体验 Python、Java 语言”的框里了,结果 vmc 就无法 login 了……
wuweixin#gmail.com thanks :)
程序执行出错了于是就退了,我是这么理解的 @元芳 你怎么看?
看这个包的命名应该是代理模式 用 C++ 都可以实现这种模式……
CakePHP 照 RubyOnRails 有很大的差距的…… 如果说早期版本的 CakePHP 和早期版本的 RoR 各有优劣的话 最新版本的 CakePHP 就被 最新版本的 RoR 远远地抛在后面了 用用你就知道了,他们的差距不是一点半点 这也是 Ruby 这类语言的优势,如果需求不停地变的话,他的重构优势非常大
扔到一个 key-value cache 里去做统计 则可以实现 IP,IP 段,用户名等等的匹配
检查检查你的 database.yml 以及 mysql 数据库的 encoding ?
大概方法:一个字段表,一个值表,允许用户在字段表里增加字段所属模型,字段类型,字段名称等等参数 然后用户在新建该模型的时候,就可以录入属于这个模型的字段了
不如直接允许自定义字段,而不是预留:)