Hi,

In one of my apps, app 1 I'm rendering html content that is generated
with another of my apps, app 2. This content generated in app2 is stored
in the public folder of app 1. It has to be stored there, it cannot be
requested by app 1 in real time. It is basically one index.html and
images and they live together in a single folder inside the public area
of app 1.

In app 1 I'm using <%= render :file => "path_to_location" %> in a view
and it goes ok more or less. But the problem is that the images are not
taken. The src attribute of all images is only the name since they live
in the same location as the index.html so when rendered the images are
not found.

I cannot write a route to fix this because the route wouldn't receive
all the details to write the redirect properly.

I know I could write the right img src when generating the content but
I'd like to avoid that since then the images wouldn't be found in app
2...

Any suggestions? Tried rendering as partial but didn't even find the
partial outside the app level.

Cheers.

--
Posted via http://www.ruby-forum.com/.

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

Search Discussions

  • comopasta Gr at Nov 10, 2011 at 11:55 am

    comopasta Gr wrote in post #1031209:
    Hi,

    In one of my apps, app 1 I'm rendering html content that is generated
    with another of my apps, app 2. This content generated in app2 is stored
    in the public folder of app 1. It has to be stored there, it cannot be
    requested by app 1 in real time. It is basically one index.html and
    images and they live together in a single folder inside the public area
    of app 1.

    In app 1 I'm using <%= render :file => "path_to_location" %> in a view
    and it goes ok more or less. But the problem is that the images are not
    taken. The src attribute of all images is only the name since they live
    in the same location as the index.html so when rendered the images are
    not found.
    I fixed my problem by making a get request to the public folder in the
    controller. I fix the src attribute of the images and then I do a render
    :inline of the response body in the view.

    --
    Posted via http://www.ruby-forum.com/.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 10, '11 at 7:22a
activeNov 10, '11 at 11:55a
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

comopasta Gr: 2 posts

People

Translate

site design / logo © 2021 Grokbase