File: public\input.html, adding this code:
Using Text Fields
Working With Text Fields
This Ruby on Rails application lets you read data from text fields.
File: app\controllers\hello_controller.rb:
class HelloController < ApplicationController
def there
@data = params[:text1]
end
end
File: app\views\hello\there.rhtml:
Reading data from text fields
Reading data from text fields
This Ruby on Rails application reads data from text fields.
Your name is <%= @data %>.
Start the WEBrick server: ruby script/server
Navigate to http://localhost:3000/input.html
readTextField.zip( 89 k)