Skip to content

Commit

Permalink
Adding equals to the available operations, removing the reference fro…
Browse files Browse the repository at this point in the history
…m the erb.
  • Loading branch information
bishboria committed Sep 10, 2011
1 parent fe0022a commit 0f87888
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions Examples/Calculator/lib/web_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
$:.unshift(File.dirname(__FILE__), '.')
require 'calculator'

Sinatra::Base.enable :inline_templates

class WebCalculator < Sinatra::Base

use Rack::Session::Pool
Expand All @@ -16,7 +14,7 @@ class WebCalculator < Sinatra::Base

helpers do
def available_operations
{ 'plus' => :+, 'minus' => :- }
{ 'plus' => :+, 'minus' => :-, 'equals' => '=' }
end

def operate_with operator
Expand Down
1 change: 0 additions & 1 deletion Examples/Calculator/views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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.