Hi this is my first post on the group and I think its an easy question. How do I assign a variable from parameter with a ''.'' dot in it. For instance filename=(params[:Manual.pdf]) 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-/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 1/29/07, B. Lars <lbrett-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi this is my first post on the group and I think its an easy > question. > > How do I assign a variable from parameter with a ''.'' dot in it. > For instance > > filename=(params[:Manual.pdf]) > > Thanks > > > > >filename = params[''Manual.pdf''] Hope that helps. -- Zack Chandler http://depixelate.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 -~----------~----~----~----~------~----~------~--~---
filename = params[''Manual.pdf''] does not set filename for me. Any other ideas? Zack Chandler wrote:> On 1/29/07, B. Lars <lbrett-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi this is my first post on the group and I think its an easy > > question. > > > > How do I assign a variable from parameter with a ''.'' dot in it. > > For instance > > > > filename=(params[:Manual.pdf]) > > > > Thanks > > > > > > > > > > > filename = params[''Manual.pdf''] > > Hope that helps. > > -- > Zack Chandler > http://depixelate.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 -~----------~----~----~----~------~----~------~--~---
Nevermind i got it to work, thank you for the help. On Jan 29, 10:06 am, "B. Lars" <lbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> filename = params[''Manual.pdf''] > does not set filename for me. Any other ideas? > > Zack Chandler wrote: > > On 1/29/07, B. Lars <lbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi this is my first post on the group and I think its an easy > > > question. > > > > How do I assign a variable from parameter with a ''.'' dot in it. > > > For instance > > > > filename=(params[:Manual.pdf]) > > > > Thanks > > > filename = params[''Manual.pdf''] > > > Hope that helps. > > > -- > > Zack Chandler > >http://depixelate.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 -~----------~----~----~----~------~----~------~--~---
B. Lars wrote:> > filename = params[''Manual.pdf'']Why is the dot in the key? Why does ''Manual.pdf'' look like a value (a real name of a real file) instead of an abstraction, like :filename? If Manual.pdf really really is the key, try params[ :''Manual.pdf'' ]> Any other ideas?p params raise params.inspect Both of those .inspect the keys, and .inspect generally turns any "instant value" into its own Ruby expression. That will show you how to write your :symbol. -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip Yeah that was my problem, I just mindlessly switched the key with the value. On Jan 29, 10:12 am, Phlip <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> B. Lars wrote: > > > filename = params[''Manual.pdf'']Why is the dot in the key? > > Why does ''Manual.pdf'' look like a value (a real name of a real file) > instead of an abstraction, like :filename? > > If Manual.pdf really really is the key, try params[ :''Manual.pdf'' ] > > > Any other ideas?p params > raise params.inspect > > Both of those .inspect the keys, and .inspect generally turns any > "instant value" into its own Ruby expression. That will show you how > to write your :symbol. > > -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---