Guest User

Untitled

a guest
May 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def plan
  2. if params[:argument]
  3. unless params[:argument] =~ /^[1-4]$/
  4. flash[:notice] = 'Invalid plan number.'
  5. redirect_to :action => :index
  6. exit
  7. return
  8. end
  9. end
  10.  
  11. @id = params[:id]
  12.  
  13. # Pick the plan and then go to the
  14. # purchase page.
  15. if params[:argument]
  16. @firm = Firm.find(@id)
  17. @firm.plan = params[:argument].to_i
  18.  
  19. if @firm.save
  20. redirect_to "/buy/first_account/#{@firm.id}"
  21. end
  22. end
  23.  
  24.  
  25. end
Add Comment
Please, Sign In to add comment