0

On my rails server, as long as I got the model object I can easily get the url of the paperclip attachment by calling @model.avatar.url(:thumb).

However I am trying to setup a restful api service where android and iOS apps will call to retrieve these image urls. How do I do that? I wrote a custom call but can't seem to be able to access the url portion of the avatar after retrieving it from the database in the controller.

Thanks

4

1 回答 1

0

解决方案是让该方法呈现内联响应,例如:

render :inline => "<%= @image.avatar.url(:thumb) %>"
于 2013-07-19T13:39:01.917 回答