How to access form data?

Hey guys,

I’ve been trying to learn Ruby and am incredibly confused. I think I am
making this way to complicated. I’ve got a simple html form:

I want to pass this value to my ruby file I have called ‘logic.rb’ and
then spit it back out to my html file. I have been reading about ERB
files and am not sure of how to use these.

Do I need to put this html file into the .rb file?? or can I have
separate files? How do I just send a form value to my ruby file and vice
versa? Could someone give me some good documentation on how to do this??
I’ve searched all over and can’t seem to find anything useful.

Hi Kevin,

ERB files work a lot like JSP or ASP in that it allows you to render
your html with ruby variables that you are sending in from your
controller (preferably, you can also do logic in it, but that’s frowned
upon).

It sounds to me like you’re trying to perform an ajax request. Are you
doing gets or posts? Is this for a Rails app, a Rack app, or something
else? It sounds like that’s the type of thing you need to know.