Hi on submission of the form ‘put’ method is used to send data from form to sinatra.the put method is defined in app.rb put method makes a call to erb file which displays the two values.
but nothing is being displayed could somebody help please.
put '/form' do
@name = params[:FirstName]
@last = params[:LastName]
erb :formact
end
form
<form name="biodata" action="form" method="put" onsubmit="validateForm()">
code
</form>
Thank you
I don’t think
PUTis a valid method for form submission. Check your HTTP server log and see if the requests are actually coming asPUTrequests — the browser might be sending them asGET, which is the default.Anyway, you should probably just use
POSTinstead.