# Beginner question getting data from textbox

**URL:** <https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389>\
**Category:** Rails\
**Created:** [March 20, 2007, 2:14am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389 "2007-03-20T02:14:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 2:14am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/1 "2007-03-20T02:14:56Z")

</div>

I am just doing a simple book exercise

and i keep getting this error in the browser:

no route found to match “/\look\at” with {:method=\>:get}

i have an action named at set up in my controller

class LookController \< ApplicationController  
def at  
@data = params[:text1]  
end

end

i have the main public page where i get the user input:

 Using Text Fields
# Working with textfields
This Ruby on Rails application lets you read data from text fields  
Please enter your name.  
  
  
  

and i have a view to spit out the data the user enters:

 Returning data from text fields in a view
# Working with textfields
This view returns the data from the text field in input.html  
  
Your name is \<%= @data %\>  
  

all the files are in the correct directories, the input.html one is in  
public the controller is in its default location and the at.rhtml file  
is in views.

What am i missing can anyone see it?

thanks

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 2:22am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/2 "2007-03-20T02:22:34Z")

</div>

Corey K. wrote:

> ```
> @data = params[:text1]
> 
> ```
> 
> http-equiv=“content-type”\>

[…snip…]

> all the files are in the correct directories, the input.html one is in  
> public the controller is in its default location and the at.rhtml file  
> is in views.
> 
> What am i missing can anyone see it?

Use forward slashes “/” in your path not backslashes “” even if you are  
on Windows.

–  
Michael W.

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 2:28am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/3 "2007-03-20T02:28:46Z")

</div>

tried that it didnt work either, still get the same routing error

> –

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 2:53am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/4 "2007-03-20T02:53:36Z")

</div>

Hi Corey, I forget step ©, (d), and (e)

c) add the file at.rhtml to /app/views/look folder if it’s not already  
there  
d) start the webserver in windows by going to the root of your rails  
application

```
 ruby script/server webrick

```

e) go to your browser and type the following in the address field

```
 http://localhost:3000/look/input

```

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 2:47am UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/5 "2007-03-20T02:47:36Z")

</div>

Hi, you should change

to

Also, I would recommend do the following:

a) change your input file to input.rhtml  
b) copy the file to app/views/look folder

The above should do what you want.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 9:00pm UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/6 "2007-03-20T21:00:39Z")

</div>

Conrad T. wrote:

> Hi Corey, I forget step ©, (d), and (e)
> 
> c) add the file at.rhtml to /app/views/look folder if it’s not already  
> there  
> d) start the webserver in windows by going to the root of your rails  
> application
> 
> ```
> ruby script/server webrick
> 
> ```
> 
> e) go to your browser and type the following in the address field
> 
> ```
> http://localhost:3000/look/input
> 
> ```
> 
> Good luck,
> 
> -Conrad

you make a point that caught my eye when you say to make the input.html  
into a view. The author says to put it in the public folder as just an  
html file, isnt the author departing from the MVC design by doing that?  
I dont know what the public folder is for at this point havnt gotten  
that far in the book. Should i generally make all web content into views  
or is there times when you want just basic html files in the public  
folder?

---

<div class="post-metadata">

**Author:** ![ckonrad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Post date:** [March 20, 2007, 8:27pm UTC](https://www.ruby-forum.com/t/beginner-question-getting-data-from-textbox/89389/7 "2007-03-20T20:27:25Z")

</div>

Conrad T. wrote:

> Hi Corey, I forget step ©, (d), and (e)
> 
> c) add the file at.rhtml to /app/views/look folder if it’s not already  
> there  
> d) start the webserver in windows by going to the root of your rails  
> application
> 
> ```
> ruby script/server webrick
> 
> ```
> 
> e) go to your browser and type the following in the address field
> 
> ```
> http://localhost:3000/look/input
> 
> ```
> 
> Good luck,
> 
> -Conrad

OK thanks, i tried it in IE and it works fine but for some reason it  
doesnt work in firefox unless i clear the entire browser cache between  
exercises. There is some information that is getting stored in the  
browser that causes that routing error i tried it several times and  
everytime it didnt work unless i cleared out all my private data in  
firefox. Its kind of one of those strange computer problems where its  
hard to see why something is happening.
