Silvy
2007-Jul-17  00:40 UTC
How to display an image that is stored on a file store outside the \public folder
I would like know how do I display images that are stored on a file store outside the public folder. I will be creating these images outside the web application but wanted to display the images. What are the options available for me. I looked at the file_column and the fleximage plugins. I could not figure it out. Could someone help me out. Thanks sm --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gene.tani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-17  04:48 UTC
Re: How to display an image that is stored on a file store outside the \public folder
On Jul 16, 5:40 pm, Silvy <silvy.math...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would like know how do I display images that are stored on a file > store outside the public folder. I will be creating these images > outside the web application but wanted to display the images. What are > the options available for me. I looked at the file_column and the > fleximage plugins. I could not figure it out. Could someone help me > out. > Thanks > smhow about: http://www.bencurtis.com/archives/2006/11/serving-protected-downloads-with-rails/ http://robertrevans.com/article/files-outside-public-directory --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
seeram_theprince
2007-Jul-17  06:14 UTC
Re: How to display an image that is stored on a file store outside the \public folder
i would like to know whethere u r storing u r image in database with binary format or not,if u r storing the image in binary format.to display them in u r application u have to write in controller, to convert the stored binary format to original image On Jul 17, 9:48 am, "gene.t...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <gene.t...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jul 16, 5:40 pm, Silvy <silvy.math...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I would like know how do I display images that are stored on a file > > store outside the public folder. I will be creating these images > > outside the web application but wanted to display the images. What are > > the options available for me. I looked at the file_column and the > > fleximage plugins. I could not figure it out. Could someone help me > > out. > > Thanks > > sm > > how about:http://www.bencurtis.com/archives/2006/11/serving-protected-downloads...http://robertrevans.com/article/files-outside-public-directory--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
sil
2007-Jul-17  13:07 UTC
Re: How to display an image that is stored on a file store outside the \public folder
Thanks for the replies. I wanted to store the actual images in the
file store outside the public folder. But have references to these
images in the database. I will be pre-rendering these images in
different formats. Basically I wanted to traverse an hierarchical tree
menu and at the end of the leaf when further branches are not there, I
wanted to display these images as thumbnails. When clicked on the
thumbnail, I would like to show the actual image. Also wanted to
implements the REST style routing.
controller
def index
    menu= Menu.find(params[:menu_id])
    @catalogues = Catalogue.find(:all, :conditions =>
"parent_id=''#{menu.id}''")
    if @catalogues  == []
    	@contents= Catalogue.find_content_for_the_catalogue(menu.id)
    end
    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @catalogues.to_xml }
    end
  end
View
*******
<% if @catalogues  != [] %>
	<% for catalogue in @catalogues %>
	  <tr>
	   <td><%= link_to catalogue.name, catalogues_path(catalogue)
%></td>
	  </tr>
	<% end %>
<% else %>
	  <tr>
		    <%  @contents.contents.each do |content| %>
				    <tr >
				      <td><%= link_to(image_tag("images/50x50/#{content.name
+"_50X50"}.png",  :border => 1), {:controller =>
''contents'',  :action
=>"show",  :id=>content.id})%>
			         </tr>
   	        <% end %>
	  </tr>
<% end %>
I would like to display these images from the file store.
Thanks
Silvy
On Jul 16, 11:14 pm, seeram_theprince
<umamaheshva...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> i would like to know whethere u r storing u r image in database with
> binary format or not,if u r storing the image in binary format.to
> display them in u r application u have to write in controller, to
> convert the stored binary format to original image
>
> On Jul 17, 9:48 am,
"gene.t...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<gene.t...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > On Jul 16, 5:40 pm, Silvy
<silvy.math...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > I would like know how do I display images that are stored on a
file
> > > store outside the public folder. I will be creating these images
> > > outside the web application but wanted to display the images.
What are
> > > the options available for me. I looked at the file_column and the
> > > fleximage plugins. I could not figure it out. Could someone help
me
> > > out.
> > > Thanks
> > > sm
>
> > how
about:http://www.bencurtis.com/archives/2006/11/serving-protected-downloads...
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---