I’m trying to make a non-model form in ruby on rails, most of the examples I can find only have one field (say a search field) or use an old way of writing a form like this An Email Form with Ruby on Rails
If anyone could show me example code of a non-model form with say two fields for the view and how I access those fields in the controller I’d be grateful.
Thanks so much.
You will need FormHelper methods:
Say you want a simple
testaction that submits todo_testaction:A simple view for test action (posts/test.html.erb):
In the posts controller:
Also you need to add these 2 actions to the routes in config/routes.rb