Hi, Wondering is there a way in paperclip to rename images as the are being saved to image_id+count ? my code in image.rb model has_attached_file :data, :styles => { :large => "371*251>", :small => "72*72>"}, :url => "/assets/:id", :path => ":rails_root/assets/docs/:id/:style/:basename.:extension" belongs_to :attachable, :polymorphic => true I am attaching file using javascript. What i am trying to do is when i want to call back images into array I want frist image to be large and second and third to be small. So if i could change name of images to be image_id plus count in array as name i would know that id_1 is large and so on. -- 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-/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.
Hi being relatively new to rails I am trying to start a simple project on using paperclip to upload an image file and create a thumbnail. However I am not sure how to use the rails plug-in? What I did was install paperclip using gem but not sure if this is the right way to go about it. require ''paperclip'' seems to fail. I also tried script/plugin install git://github.com/thoughtbot/paperclip.git I don''t see the plugin downloaded when I look in ''vendos/plugin'' folder? I get an error when I run the sample code using the following as an example: http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ NoMethodError in UsersController#new undefined method `has_attached_file'' for #<Class:0x7f645b46a700> RAILS_ROOT: /home/yadav/tmp/rails/PaperclipDemo Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in `method_missing'' /home/yadav/tmp/rails/PaperclipDemo/app/models/user.rb:3 /home/yadav/tmp/rails/PaperclipDemo/app/controllers/users_controller.rb:6:in `new'' -- Kind Regards, Rajinder Yadav -- 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.
doing this: rails testapp cd testapp script/plugin install git://github.com/thoughtbot/paperclip.git <http://github.com/thoughtbot/paperclip.git>you don''t see paperclip in vendor/plugins? if you do a script/plugin install git:// github.com/Shopify/active_merchant.git do you see active_merchant in vendor/plugins? do you have git installed? if it''s installing these plugins without errors and you''re not seeing them in vendor/plugins that seems very strange On Thu, Feb 25, 2010 at 6:45 AM, Rajinder Yadav <devguy.ca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi being relatively new to rails I am trying to start a simple project on > using paperclip to upload an image file and create a thumbnail. > > However I am not sure how to use the rails plug-in? What I did was install > paperclip using gem but not sure if this is the right way to go about it. > > require ''paperclip'' seems to fail. > > I also tried > > script/plugin install git://github.com/thoughtbot/paperclip.git > > I don''t see the plugin downloaded when I look in ''vendos/plugin'' folder? I > get an error when I run the sample code using the following as an example: > > http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ > > NoMethodError in UsersController#new > undefined method `has_attached_file'' for #<Class:0x7f645b46a700> > RAILS_ROOT: /home/yadav/tmp/rails/PaperclipDemo > Application Trace | Framework Trace | Full Trace > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in > `method_missing'' > /home/yadav/tmp/rails/PaperclipDemo/app/models/user.rb:3 > /home/yadav/tmp/rails/PaperclipDemo/app/controllers/users_controller.rb:6:in > `new'' > > > -- > Kind Regards, > Rajinder Yadav > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, 2010-02-25 at 09:45 -0500, Rajinder Yadav wrote:> Hi being relatively new to rails I am trying to start a simple project > on using paperclip to upload an image file and create a thumbnail. > > However I am not sure how to use the rails plug-in? What I did was > install paperclip using gem but not sure if this is the right way to go > about it. > > require ''paperclip'' seems to fail. > > I also tried > > script/plugin install git://github.com/thoughtbot/paperclip.git > > I don''t see the plugin downloaded when I look in ''vendos/plugin'' folder? > I get an error when I run the sample code using the following as an example:---- use either gem or plugin, not both if you use the gem, add to config/environment.rb config.gem "paperclip" not needed for plugin. You need to remove either the plugin or the gem. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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.
Craig White wrote:> On Thu, 2010-02-25 at 09:45 -0500, Rajinder Yadav wrote: >> Hi being relatively new to rails I am trying to start a simple project >> on using paperclip to upload an image file and create a thumbnail. >> >> However I am not sure how to use the rails plug-in? What I did was >> install paperclip using gem but not sure if this is the right way to go >> about it. >> >> require ''paperclip'' seems to fail. >> >> I also tried >> >> script/plugin install git://github.com/thoughtbot/paperclip.git >> >> I don''t see the plugin downloaded when I look in ''vendos/plugin'' folder? >> I get an error when I run the sample code using the following as an example: > ---- > use either gem or plugin, not both > > if you use the gem, add to config/environment.rb > > config.gem "paperclip"Great thanks, got it working!> not needed for plugin. You need to remove either the plugin or the gem. > > Craig-- 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.
ben wiseley wrote:> doing this: > > rails testapp > cd testapp > script/plugin install git://github.com/thoughtbot/paperclip.git > <http://github.com/thoughtbot/paperclip.git> > > <http://github.com/thoughtbot/paperclip.git>you don''t see paperclip in > vendor/plugins? > > if you do a script/plugin > install git://github.com/Shopify/active_merchant.git > <http://github.com/Shopify/active_merchant.git> do you see > active_merchant in vendor/plugins? > > do you have git installed? if it''s installing these plugins without > errors and you''re not seeing them in vendor/plugins that seems very strangeBen thanks for you reply, I realized I didn''t have git install, thought I did. I got it working the way Craig said.> On Thu, Feb 25, 2010 at 6:45 AM, Rajinder Yadav <devguy.ca > <http://devguy.ca>@gmail.com <http://gmail.com>> wrote: > > Hi being relatively new to rails I am trying to start a simple > project on using paperclip to upload an image file and create a > thumbnail. > > However I am not sure how to use the rails plug-in? What I did was > install paperclip using gem but not sure if this is the right way to > go about it. > > require ''paperclip'' seems to fail. > > I also tried > > script/plugin install git://github.com/thoughtbot/paperclip.git > <http://github.com/thoughtbot/paperclip.git> > > I don''t see the plugin downloaded when I look in ''vendos/plugin'' > folder? I get an error when I run the sample code using the > following as an example: > > http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ > > NoMethodError in UsersController#new > undefined method `has_attached_file'' for #<Class:0x7f645b46a700> > RAILS_ROOT: /home/yadav/tmp/rails/PaperclipDemo > Application Trace | Framework Trace | Full Trace > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in > `method_missing'' > /home/yadav/tmp/rails/PaperclipDemo/app/models/user.rb:3 > /home/yadav/tmp/rails/PaperclipDemo/app/controllers/users_controller.rb:6:in > `new'' > > > -- > Kind Regards, > Rajinder Yadav > > ---- 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.