阅读背景:

Ruby on Rails - 将属性添加到ActiveRecord :: Base但不想在数据库中保留,但应该在对象json中

来源:互联网 

I have a ActiveRecord::Base model called "Entry". It has a file attached to it. I am uploading files using Paperclip. Now, everything is merry when I using Views and using serverside code in the views. But now, I want to use the JSON and AJAX, render the front end in pure HTML5. So, for that, I will need the URL of the file. But paperclip only stores the file name, file content type etc and I can retrieve the url of the file with,I have a ActiveRecord::Base model called "Entry




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: