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: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Using Text Fields</title> </head> <body> <h1>Working with textfields</h1> This Ruby on Rails application lets you read data from text fields <br> <form action = "\look\at" > Please enter your name. <br> <input type="text" name="text1" > <br> <br> <input type="submit" /> </form> <br> </body> </html> and i have a view to spit out the data the user enters: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Returning data from text fields in a view</title> </head> <body> <h1>Working with textfields</h1> This view returns the data from the text field in input.html <br> <br> Your name is <%= @data %> <br> <br> </body> </html> 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 -- 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 -~----------~----~----~----~------~----~------~--~---
Corey Konrad wrote:> 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: > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta content="text/html; charset=ISO-8859-1" > http-equiv="content-type"> > <title>Using Text Fields</title> > </head> > <body> > <h1>Working with textfields</h1> > This Ruby on Rails application lets you read data from text fields > <br> > <form action = "\look\at" > > Please enter your name. > <br> > <input type="text" name="text1" > > <br> > <br> > <input type="submit" /> > </form> > <br> > </body> > </html> >[...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 Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<form action = "/look/at" > tried that it didnt work either, still get the same routing error> ---- 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 -~----------~----~----~----~------~----~------~--~---
Hi, you should change <form action = "\look\at" > to <form action="/look/at" > 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 On 3/19/07, Corey Konrad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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: > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta content="text/html; charset=ISO-8859-1" > http-equiv="content-type"> > <title>Using Text Fields</title> > </head> > <body> > <h1>Working with textfields</h1> > This Ruby on Rails application lets you read data from text fields > <br> > <form action = "\look\at" > > Please enter your name. > <br> > <input type="text" name="text1" > > <br> > <br> > <input type="submit" /> > </form> > <br> > </body> > </html> > > > and i have a view to spit out the data the user enters: > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta content="text/html; charset=ISO-8859-1" > http-equiv="content-type"> > <title>Returning data from text fields in a view</title> > </head> > <body> > <h1>Working with textfields</h1> > This view returns the data from the text field in input.html > <br> > <br> > Your name is <%= @data %> > <br> > <br> > </body> > </html> > > 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 > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Hi Corey, I forget step (c), (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 On 3/19/07, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, you should change > > <form action = "\look\at" > > > to > > <form action="/look/at" > > > 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 > > On 3/19/07, Corey Konrad <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > 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: > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > > <html> > > <head> > > <meta content="text/html; charset=ISO-8859-1" > > http-equiv="content-type"> > > <title>Using Text Fields</title> > > </head> > > <body> > > <h1>Working with textfields</h1> > > This Ruby on Rails application lets you read data from text fields > > <br> > > <form action = "\look\at" > > > Please enter your name. > > <br> > > <input type="text" name="text1" > > > <br> > > <br> > > <input type="submit" /> > > </form> > > <br> > > </body> > > </html> > > > > > > and i have a view to spit out the data the user enters: > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > > <html> > > <head> > > <meta content="text/html; charset=ISO-8859-1" > > http-equiv="content-type"> > > <title>Returning data from text fields in a view</title> > > </head> > > <body> > > <h1>Working with textfields</h1> > > This view returns the data from the text field in input.html > > <br> > > <br> > > Your name is <%= @data %> > > <br> > > <br> > > </body> > > </html> > > > > 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 > > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
Conrad Taylor wrote:> Hi Corey, I forget step (c), (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, > > -ConradOK 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. -- 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 -~----------~----~----~----~------~----~------~--~---
Conrad Taylor wrote:> Hi Corey, I forget step (c), (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, > > -Conradyou 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? -- 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 -~----------~----~----~----~------~----~------~--~---