I can''t make this work: http://groups.google.com/group/paperclip-plugin/browse_thread/thread/c8f58f0a4ef45d20/95e66f07c5722d96?lnk=gst&q=rename#95e66f07c5722d96 Where I have to place this code? Paperclip::Attachment.interpolations[:random_key] = lambda do | attachment, style| attachment.instance.random_key end I always get: undefined method `random_key'' Rais 2.3.2 and paperclip installed by gem -- 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-/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 -~----------~----~----~----~------~----~------~--~---
I have this problem only if I run Rails by mongrel_cluster. ./script/server works fine. -- 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-/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 -~----------~----~----~----~------~----~------~--~---
As I remember u can not use lambda do do |abc | end U must use : lambda {| abc| } On Mar 26, 6:16 pm, Fresh Mix <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have this problem only if I run Rails by mongrel_cluster. > > ./script/server works fine. > -- > Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---
On Fri, Mar 27, 2009 at 2:59 AM, robdoan <quydoantran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > As I remember u can not use lambda do do |abc | > end > U must use : lambda {| abc| } > >lambda do |abc| ... end is equivalent to lambda { |abc| ... } Thus, they are both legal in Ruby 1.8 and 1.9. -Conrad> > On Mar 26, 6:16 pm, Fresh Mix <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > I have this problem only if I run Rails by mongrel_cluster. > > > > ./script/server works fine. > > -- > > Posted viahttp://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-/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 Mar 27, 12:28 pm, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Fri, Mar 27, 2009 at 2:59 AM, robdoan <quydoant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > As I remember u can not use lambda do do |abc | > > end > > U must use : lambda {| abc| } > > lambda do |abc| > ... > end > > is equivalent to > > lambda { |abc| ... } > > Thus, they are both legal in Ruby 1.8 and 1.9. >{} binds more tightly than do..end so you do sometimes need to use () to disambiguate, eg named_scope :foo, lambda { ... } is ok but named_scope :foo, lambda do ... end isn''t because ruby thinks that this block is for named_scope, not lambda. named_scope(:foo, lambda do ... end) makes it clear to ruby what to do. Fred> -Conrad > > > > > On Mar 26, 6:16 pm, Fresh Mix <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > wrote: > > > I have this problem only if I run Rails by mongrel_cluster. > > > > ./script/server works fine. > > > -- > > > Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---