Class: Payable::WelcomeController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Payable::WelcomeController
- Defined in:
- app/controllers/payable/welcome_controller.rb
Instance Method Summary collapse
Instance Method Details
#checkout ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/payable/welcome_controller.rb', line 8 def checkout @order = Order.find(params[:id]) begin @order.checkout_bill redirect_to :controller => "welcome", :action => "json_form", :id => @order.id rescue flash[:error] = $!. redirect_to root_url end end |
#index ⇒ Object
3 4 5 6 |
# File 'app/controllers/payable/welcome_controller.rb', line 3 def index Order.create(:value => rand(100) * 1.234, :bill_status => 'open') if Order.open.size.zero? @orders = Order.order('id DESC').all end |
#json_form ⇒ Object
20 21 22 |
# File 'app/controllers/payable/welcome_controller.rb', line 20 def json_form @order = Order.find(params[:id]) end |