# Params with '.' dot in them

**URL:** <https://www.ruby-forum.com/t/params-with-dot-in-them/83775>\
**Category:** Rails\
**Created:** [January 29, 2007, 5:48pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775 "2007-01-29T17:48:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 5:48pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/1 "2007-01-29T17:48:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/2 "2007-01-29T17:57:20Z")

</div>

filename = params[‘Manual.pdf’]

Hope that helps.

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/3 "2007-01-29T18:07:23Z")

</div>

filename = params[‘Manual.pdf’]  
does not set filename for me. Any other ideas?

---

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 6:14pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/4 "2007-01-29T18:14:35Z")

</div>

Nevermind i got it to work, thank you for the help.

---

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 6:13pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/5 "2007-01-29T18:13:34Z")

</div>

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](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![BSLars](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e5b9ba/32.png) [@BSLars](https://www.ruby-forum.com/u/BSLars)\
**Post date:** [January 29, 2007, 8:29pm UTC](https://www.ruby-forum.com/t/params-with-dot-in-them/83775/6 "2007-01-29T20:29:21Z")

</div>

Phlip

Yeah that was my problem, I just mindlessly switched the key with the  
value.
