在rails2.0以下版本下开发的时候,参照“整合File-Column和Rmagick功能实现图片上传“http://airport.iteye.com/blog/33216
就可以实现图片的上传。
但是在rails2.0中,当在show.html.erb实现图片显示:
原始大小:
<%= image_tag url_for_file_column 'entry', 'image' %>
<br>
thumb:
<%= image_tag url_for_file_column 'entry', 'image' ,'thumb'%>
报错提示:
查找了很多地方,没有找到答案。
就可以实现图片的上传。
但是在rails2.0中,当在show.html.erb实现图片显示:
原始大小:
<%= image_tag url_for_file_column 'entry', 'image' %>
<br>
thumb:
<%= image_tag url_for_file_column 'entry', 'image' ,'thumb'%>
报错提示:
Showing groups/show.html.erb where line #2 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.relative_url_root
Extracted source (around line #2):
1: <div id="group" class="group">
2: <%= image_tag url_for_file_column 'group', 'ico' %>
3: </div>
4: <div id="gcomments" class="gcomments">
5:
查找了很多地方,没有找到答案。