From: jonty Date: 2009-04-21T03:28:40+09:00 Subject: Re: Sinatra : examples and FRAME. B. Randy wrote: > Hi, > I'm working on Sinatra for days. The 'book' and the 'FAQ' are clear but > haven't real examples. > > I use only "dbi" for database, I'm using Oracle with real tables. > > On a page, I have a FORM and below I would see the result of the > request. > > I have tried something like : > - I use a session; > - put the form in the main page '/', the form make a "post 'action'"; > - make a " get '/'"; > - make a "post 'action'", work on data, " redirect '/'". The selected > value in the form are lost. I must make a reload of the page to see the > selected values of the form. > > > This is my problems : > - How to have a form AND the result of this form in the same page ? > - How to recall the values taken from the form in the form ? > - May be using some frames is a good idea but I don't see how to define > the "src" attribute ? > > Well, some have a real and SIMPLE example of a web application for > Sinatra ? or could help me to find a solution ? > > I'll take the ideas :) > > Thanks. > I don't see the need to use frames, it is just a question of saving your data in the post method and reading your data in the get The get will fetch the current data save it in an instance variable (@variable) and refer to a template that includes your form which has an href of '/' and method post but can also display the current data from the @variable. Hope this is of help > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.287 / Virus Database: 270.12.0/2068 - Release Date: 04/19/09 20:04:00 > >