@bony include ApplicationHelp??还是错误
@cqpx 哦,我也想到是 mongoid 的方法,我是用 activerecord 的,没类似的魔法方法?gg 搜不到!
@huacnlee field :post_count, :type => Integer 这里不属于 activerecord>??
@cqpx 参考中!!!谢谢!!!
@ashchan 求代码!有点模糊
@Rei 就是实现一个文章发表排行榜!以数量为排名参考!
@huacnlee 又有这个错误了 model 我已经去到个 s····
ActionView::Template::Error (undefined method `index' for #<Class:0x007f980d7d53c8>):
15: </span>
16: </div>
17: <div class="comments_show">
18: <%= render_cell :comments, :show, :commentable => @micropost, :current_user => current_user %>
19: </div>
20: </td>
21: </tr>
app/models/comment.rb:7:in `<class:Comment>'
app/models/comment.rb:1:in `<top (required)>'
app/cells/comments_cell.rb:6:in `show'
@huacnlee 原来是我的 model 问题,应该是 comment,而不是 comments
@huacnlee 这里
class Comments < ActiveRecord::Base
attr_accessible :comment
belongs_to :user
belongs_to :comentable, :polymorphic => true
index :user_id
index :commentable_type
index :commentable_id
validates_presence_of :comment
end
ActionView::Template::Error (uninitialized constant CommentsCell::Comment):
15: </span>
16: </div>
17: <div class="comments_show">
18: <%= render_cell :comments, :show, :commentable => @micropost, :current_user => current_user %>
19: </div>
20: </td>
21: </tr>
app/cells/comments_cell.rb:6:in `show'
应该是版本问题!
改成这种就没问题了
@metal gem 应该是没问题的,要不 redcarpet 等相关的类就会报错的!
@huacnlee 在 ie9,火狐,chrome,safari 测试 OK!
实在太无聊了!!!原生的文件上传不能用 remote,只能自己写,或者用插件!推荐插件https://github.com/leppert/remotipart
@huacnlee 我把 form 的 remote => true 去掉,提交后的效果一样,是不是证明 remote => true 失效了,但是我看源代码,有生成 data-remote="true"
其实我有另外一个是用了 remote,是成功的,不过那个不是上传文件,这个是,真郁闷
@huacnlee 加了,有的! //= require jquery //= require jquery-ui //= require jquery_ujs //= require autocomplete-rails //= require_tree .
@huacnlee 视图文件夹下只有 create.js.erb 一个文件,index 的 action 我是直接返回 json 的,我不明白就是,一提交,他一定会转到 localhost/microphotos
@huacnlee 相关的代码