只显示主题贴
我也发现了这个问题,不知道怎么回事,很多地方都直接用<input>写了
- 进入论坛 Ruby 版
先说验证问题。
按照传统的file_column :image, :magick => xxx
无论你想不想验证,file_column 都会验证上传的文件是不是图形文件,如果不是,它会在你的模型错误里面加"invalid image"。该错误验证的地方在 magick_file_column.rb里。查找
if options[:magick][:image_required]
@magick_errors ||= []
@magick_errors << "invalid image"
end
可以将第3行修改为:
@magick_errors & ...
- 进入论坛 Ruby 版
你按他的提示做试试。
has_many :comperes,
:through => :discussants,
:source => :user,
:conditions => ['role = 6']
- 进入论坛 Ruby 版
如果是关联有问题,应该报 undefined method 'category' for #<Book:xxxx>
- 进入论坛 入门讨论 版
The error occurred while evaluating nil.name
是说这个book没有category.所以报的错的是 nil.name
而不是book.category
- 进入论坛 入门讨论 版
User has_many Categories
Category has_many Posts
当Category和Post同为多态时。这样
class User < ActiveRecord::Base
has_many :categories, :as => :owner #owner_id owner_type
has_many :posts, :through => :categories
end
class Category < ActiveRecord::Base
has_many :posts, :as => :postable #post ...
- 进入论坛 Ruby 版
换成jrails以后,基本的功能都有,但是今天突然想用到in_place_editor,却发现没有这个功能。于是乎,百度伺候,无解- -。那就只有google了。最后发现了rails_in_place_editing这个很小的插件:http://github.com/rakuto/jrails_in_place_editing/tree/master
基本用法和原来的in_place_editor一样。
但是这个先得把文件夹里的javascript下的文件拷到public/javascript下。不知道是不是我的问题,反正不拷过去我没用上。
用来text一切正常。我的应用是要用作select。 ...
- 进入论坛 Ruby 版
不要激动,这很正常的。毕竟论坛也有论坛的规矩。呵呵。
BTW, 刚看到这贴时,已经知道这事会发生了。。。^_^
- 进入论坛 入门讨论 版







评论排行榜