Arc Forum | Here's the same thing translated into Ruby + custom Web Framework + Tenjin:<...

2 points by namaste 6497 days ago | link | parent

Here's the same thing translated into Ruby + custom Web Framework + Tenjin:

<?rb

 if @w.req.post?
 @w.session['said'] = @w.f('said')
 @w << '<a href="">click here</a>'
 else
 if @w.session['said']
 @w << "You said: #{@w.session['said']}"
 @w.session.unset 'said'
 else
 @w << '<form method="post">'
 @w << '<input type="text" name="said">'
 @w << '<input type="submit">'
 @w << '</form>'
 end
 end
?>

BTW, your example made me spot a bug and fix it and also add the "unset" method to the Session class. Cool enough. Thanks! :-)




AltStyle によって変換されたページ (->オリジナル) /