This file contains hidden or 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 BasketController | |
def add_to_basket | |
item = Item.find_by_title(params[:item_title]) | |
basket = $basket | |
basket.add_item(item) | |
if basket.count_items > 10 | |
basket.error_messages.add("Too many items in the basket") |
This file contains hidden or 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 Gladiator | |
def say_hello | |
puts "Поклон тебе, Цезарь!" | |
yield if block_given? | |
puts "Идущие на смерть приветствуют тебя!" | |
end | |
end |