You're hardcoding the value to "0" with this part of the code
value="0"
you could change the lines to
<input type=text name="operand_one" value="@value_one"></td> #etc...
and in your controller
@value_one = 0 unless X
but X
depends on how your controller works - do you go to a new action to solve the problem in the calculator? if so you'll have to use the params hash.
Not related to the question, but why are you using text for your calculation fields? and are you hard coding that html or it's just the output?