public urls

197 views
Skip to first unread message

The Net Duck

unread,
May 17, 2011, 5:13:03 PM5/17/11
to carrierwave
HI

I was trying to find a method that would return a public url for stuff
and couldn't find one. I'm working with a mobile app and have the need
to include my hostname in my url. I was thinking of creating a module
that would allow you to do something like

image.url(:host => true)

so that there would be the option to include the host however I didn't
want to do that unless people felt like it was needed. I can always
accomplish the same task with something like

root_url + image.url

so I thought I would post this up here and see if you guys are
interested in something like this. I've been wanted to contribute to
some projects so would be more than happy figuring it out.

- The Net Duck

Ankur

unread,
May 18, 2011, 6:38:46 AM5/18/11
to carrierwave
Which storage method are you using?

Jonas Nicklas

unread,
May 18, 2011, 3:29:58 PM5/18/11
to carri...@googlegroups.com
The tricky problem with this is that you need access to the request
object to generate the full URL. Since CarrierWave only works on the
model layer, you won't be able to get at the request object. I'd
create a view helper or something like that for this.

/Jonas

> --
> You received this message because you are subscribed to the Google Groups "carrierwave" group.
> To post to this group, send email to carri...@googlegroups.com.
> To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages