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
def SomeController < ApplicationController | |
def some_action_1 | |
line_item = LineItem.find(params[:line_item_id]) | |
user_qty = Integer(params[:user_qty]) rescue nil | |
unless user_qty && (1...line_item.quantity) === user_qty | |
render partial: '/my/error/partial' | |
return | |
end | |
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
books: | |
id | title | price | genre_id | |
-------------------------------------------------- | |
1 | Gone With the Wind | 15 | 1 | |
2 | The Lord of the Rings | 30 | 2 | |
3 | The Hobbit | 10 | 2 | |
4 | Pride and Predjudice | 10 | 1 | |
5 | Complete Sherlock Holmes | 9 | 4 |