I’m trying to get my head around the implementation of Ruby forms. This
is not Rails. I’m messing around in Sinatra and wanted to know how to
receive submitted forms. I’ve looked at CGI and the params tag, but I’m
unclear as to which one should be used.
Any urls and insight appreciated as I can’t find much out there. I’m
confused between the two applications and I can’t seem to get params to
work properly.
I’m trying to get my head around the implementation of Ruby forms. This is not
Rails. I’m messing around in Sinatra and wanted to know how to receive submitted
forms. I’ve looked at CGI and the params tag, but I’m unclear as to which one
should be used.
Any urls and insight appreciated as I can’t find much out there. I’m confused
between the two applications and I can’t seem to get params to work properly.
I’m building a small app using Sinatra. Here you can see the routes[1]
and the views[2].
The “routes" are composed of two ‘paths’ the ‘get’ and the ‘post’ which
‘redirects’ depending on the situation.
The “views” are made using HAML which is a syntax-sugar for HTML like
ERB, LESS, etc. I’m using CSS but you could use SASS instead if you like
it…
Does Ruby qua Ruby even have a concept of HTML forms? It seems like
that’d be something that would exist only in the context of
Ruby+RailsOrSinatra. I think that for someone to answer your question,
they’d have to understand Sinatra’s form handling, rather than Ruby’s.
Yeah the whole Sinatra thing I have working. It’s the submission of
forms which got me. I’m reading about ARGV and params, and I was having
trouble getting around the latter. I will be taking a look at your Ruby
though. It seems you’re just searching through params, so that’s
essentially what I was looking for. I need more testing.
Ya that’s pretty much what I’m trying to find out. It wasn’t evident
that it would be a Sinatra concept, seeing that Sinatra lies upon Ruby
itself. Previous languages I’ve used had it built in as action_params.
It seems Request is the go-to for all that in Sinatra.
Cheers
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.