Skip to content
Browse files

Adding equals to the available operations, removing the reference fro…

…m the erb.
  • Loading branch information...
1 parent fe0022a commit 0f878881310b9b66ba3d1c3138d298489406f68b @bishboria bishboria committed Sep 10, 2011
Showing with 1 addition and 4 deletions.
  1. +1 −3 Examples/Calculator/lib/web_calculator.rb
  2. +0 −1 Examples/Calculator/views/index.erb
View
4 Examples/Calculator/lib/web_calculator.rb
@@ -4,8 +4,6 @@
$:.unshift(File.dirname(__FILE__), '.')
require 'calculator'
-Sinatra::Base.enable :inline_templates
-
class WebCalculator < Sinatra::Base
use Rack::Session::Pool
@@ -16,7 +14,7 @@ class WebCalculator < Sinatra::Base
helpers do
def available_operations
- { 'plus' => :+, 'minus' => :- }
+ { 'plus' => :+, 'minus' => :-, 'equals' => '=' }
end
def operate_with operator
View
1 Examples/Calculator/views/index.erb
@@ -4,5 +4,4 @@
<% @operations.each do |key, value| %>
<input type="submit" name="operator" id="<%=key%>" text="<%=value%>" value="<%=key%>" />
<% end %>
- <input type="submit" name="operator" id="equals" text="=" value="equals" />
</form>

0 comments on commit 0f87888

Please sign in to comment.
Something went wrong with that request. Please try again.