Hi all, I want to display the picture(BLOD type in sqlite3 in Ubuntu) I cannot display picture on the screen., i just show some decode stuff. and i try to use the plug in paperclip.. and when i install it on the current project,, I cannot run my server in Terminal,, please give me some advice Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 10 June 2011 16:40, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I want to display the picture(BLOD type in sqlite3 in Ubuntu) > I cannot display picture on the screen., i just show some decode > stuff.It is no good just saying you cannot display it and you get some ''decode stuff''. Show us the code you have written that you think should display the picture and whatever is shown on screen where the image should be displayed. First have a look at the html being generated (View > Page Source or similar in your browser) and make sure that the html being generated is what you expect. I would expect you to be using image_tag to show the image.> and i try to use the plug in paperclip.. > and when i install it on the current project,, I cannot run my server > in Terminal,,Is this a separate question? If so I would advise just having one question in a post, otherwise the answers to the two questions will get mixed up. Again though it is no good just saying you cannot run the server, otherwise the only reply you will get is that you are doing something wrong. Tell us the error message when you run the server. Colin Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
in view: <%=-2G/Efcufjc6X0zQIGAV3lg@public.gmane.org %> in controller @user=Picture.all( :joins => :culture, :conditions => (Phrase.joins(:description))).first and it shows this on the screen, GIF89a � ��ý����f�* ����zd����:2eZJ�������R �̙����ݼ�iZA:0��ޙ������B ���|||����^R����c �������Ͼ�ϫthS� if i use ==> <%=image_tag(@user.image) %> it will error me "string contains null byte" give help.. thanks On Fri, Jun 10, 2011 at 11:47 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 10 June 2011 16:40, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi all, > > > > I want to display the picture(BLOD type in sqlite3 in Ubuntu) > > I cannot display picture on the screen., i just show some decode > > stuff. > > It is no good just saying you cannot display it and you get some > ''decode stuff''. Show us the code you have written that you think > should display the picture and whatever is shown on screen where the > image should be displayed. First have a look at the html being > generated (View > Page Source or similar in your browser) and make > sure that the html being generated is what you expect. I would expect > you to be using image_tag to show the image. > > > and i try to use the plug in paperclip.. > > and when i install it on the current project,, I cannot run my server > > in Terminal,, > > Is this a separate question? If so I would advise just having one > question in a post, otherwise the answers to the two questions will > get mixed up. Again though it is no good just saying you cannot run > the server, otherwise the only reply you will get is that you are > doing something wrong. Tell us the error message when you run the > server. > > Colin > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- -------------------------------- Thank you, Yen -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
On 10 Jun 2011, at 17:11, joanne ta <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> in view: > <%=-2G/Efcufjc6X0zQIGAV3lg@public.gmane.org %>That''s just dumping the raw data into the page. Your browser won''t know that the data represents an image unless there is an img tag, whose src attribute points at an action in your app that will send back the data comprising the image. You might also consider embedding the images inline via a data: url Fred> > in controller > > @user=Picture.all( > :joins => :culture, > :conditions => (Phrase.joins(:description))).first > > and it shows this on the screen, > > GIF89a � ��ý����f�* ����zd����:2eZJ�������R �̙����ݼ�iZA:0��ޙ������B ���|||����^R����c �������Ͼ�ϫthS� > > > if i use ==> <%=image_tag(@user.image) %> it will error me "string contains null byte" > > give help.. thanks > > > On Fri, Jun 10, 2011 at 11:47 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > On 10 June 2011 16:40, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi all, > > > > I want to display the picture(BLOD type in sqlite3 in Ubuntu) > > I cannot display picture on the screen., i just show some decode > > stuff. > > It is no good just saying you cannot display it and you get some > ''decode stuff''. Show us the code you have written that you think > should display the picture and whatever is shown on screen where the > image should be displayed. First have a look at the html being > generated (View > Page Source or similar in your browser) and make > sure that the html being generated is what you expect. I would expect > you to be using image_tag to show the image. > > > and i try to use the plug in paperclip.. > > and when i install it on the current project,, I cannot run my server > > in Terminal,, > > Is this a separate question? If so I would advise just having one > question in a post, otherwise the answers to the two questions will > get mixed up. Again though it is no good just saying you cannot run > the server, otherwise the only reply you will get is that you are > doing something wrong. Tell us the error message when you run the > server. > > Colin > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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. > > > > > -- > -------------------------------- > > Thank you, > > Yen > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Here''s how I display images with paperclip: <% if items.picture.url(:medium) =~ /missing.png/ %> <%= link_to image_tag( items.picture.url,:size => ''300x300'', :border=> 0), items.picture.url, :target => ''_blank'' %> <% else %> <%= link_to image_tag( items.picture.url(:medium), :border=> 0), items.picture.url, :target => ''_blank'' %> <% end %> Notice the image tag - items.picture.url not the base object. Hope this helps. On Jun 10, 12:11 pm, joanne ta <joanne0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> in view: > <%...@patient.image %> > > in controller > > @user=Picture.all( > :joins => :culture, > :conditions => (Phrase.joins(:description))).first > > and it shows this on the screen, > > GIF89a ý f * zd :2eZJ R ̙ ݼ iZA:0 ޙ B ||| ^R c Ͼ ϫthS > > if i use ==> <%=image_tag(@user.image) %> it will error me "string contains > null byte" > > give help.. thanks > > > > > > > > > > On Fri, Jun 10, 2011 at 11:47 AM, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > On 10 June 2011 16:40, joanne <joanne0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi all, > > > > I want to display the picture(BLOD type in sqlite3 in Ubuntu) > > > I cannot display picture on the screen., i just show some decode > > > stuff. > > > It is no good just saying you cannot display it and you get some > > ''decode stuff''. Show us the code you have written that you think > > should display the picture and whatever is shown on screen where the > > image should be displayed. First have a look at the html being > > generated (View > Page Source or similar in your browser) and make > > sure that the html being generated is what you expect. I would expect > > you to be using image_tag to show the image. > > > > and i try to use the plug in paperclip.. > > > and when i install it on the current project,, I cannot run my server > > > in Terminal,, > > > Is this a separate question? If so I would advise just having one > > question in a post, otherwise the answers to the two questions will > > get mixed up. Again though it is no good just saying you cannot run > > the server, otherwise the only reply you will get is that you are > > doing something wrong. Tell us the error message when you run the > > server. > > > Colin > > > Colin > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > -------------------------------- > > Thank you, > > Yen-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.