Created
October 5, 2015 02:03
-
-
Save sqfmason/924e633e6bfadb7ad446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TipController < ApplicationController | |
def form | |
@meal_cost = params[:meal] | |
@tip_percent= params[:tip] | |
@amount_of_people= params[:amount] | |
end | |
end | |
def result | |
result = (@meal_cost * @tip_percent/100)/@amount_of_people | |
render result | |
end | |
Error message | |
NoMethodError in Tip#result | |
Showing /Users/Qureshi/Desktop/learning ruby/omnicalc/checkpoint-1/tip_calculator/app/views/tip/result.html.erb where line #5 raised: | |
undefined method `*' for nil:NilClass | |
Extracted source (around line #10): | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment