In code:
<% @offer2.each do |offer|%>
<% @menuName=Menu.find_by_menu_item_name(offer.menuName_get)%>
<% @line_item.each do |line_item|%>
<%@validPrice=(@menuName.price)*(offer.disAmountOrPercentage)%>
<%end%>
<%end%>
I am new in rails.I want to add @validPrice += @validPrice but it's not working inside the loop or outside the loop.So how do I get the sum of this variable.
snake_casefor method names and variables.