I have uploaded image form a form and save it in public/images directory and had saved its information in a table. Now i want whenever i click the image its enlarged view can be seen. What should i do? Should i create thumbnail? If yes, how? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jul 3, 2:35 am, Mona <cs.mamo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have uploaded image form a form and save it in public/images > directory and had saved its information in a table. Now i want > whenever i click the image its enlarged view can be seen. What should > i do? Should i create thumbnail? If yes, how?Checkout the Attachment_fu plugin: http://svn.techno-weenie.net/projects/plugins/attachment_fu/ --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
and rmagick sudo gem install rmagick (or image science) they are the libraries that do the resizing. in your model, you want: has_attachment :content_type => :image, :storage => :file_system, :max_size => 500.megabytes, :path_prefix => File.join(''public'', ''assets'', ''''), :resize_to => ''440x594'', :thumbnails => { :thumb => [150, 203], :small => [65, 88] } validates_as_attachment then in your views you can do; @modelname.public_filename and returns where the image is stored (which by default is not public/ images but public/assets) but it doesnt matter because its all behind the scenes for you. hope it helps On Jul 3, 1:14 pm, Matt Darby <m...-0eUD8CxtpZOb3c84sXp8cg@public.gmane.org> wrote:> On Jul 3, 2:35 am, Mona <cs.mamo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have uploaded image form a form and save it in public/images > > directory and had saved its information in a table. Now i want > > whenever i click the image its enlarged view can be seen. What should > > i do? Should i create thumbnail? If yes, how? > > Checkout the Attachment_fu plugin:http://svn.techno-weenie.net/projects/plugins/attachment_fu/--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---