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
on 2007-01-29 17:48
on 2007-01-29 17:57
filename = params['Manual.pdf'] Hope that helps. -- Zack Chandler http://depixelate.com
on 2007-01-29 18:07
filename = params['Manual.pdf'] does not set filename for me. Any other ideas?
on 2007-01-29 18:13
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!!
on 2007-01-29 18:14
Nevermind i got it to work, thank you for the help.
on 2007-01-29 20:29
Phlip Yeah that was my problem, I just mindlessly switched the key with the value.