fork download
  1. class ApplicationController < ActionController::Base
  2. before_filter :set_product
  3.  
  4. private
  5.  
  6. def set_product
  7. @product ||= Product.new(params[:product])
  8. end
  9. end
  10.  
  11. class ProductController < ApplicationController
  12. def new
  13. end
  14.  
  15. def create
  16. if @product.category == "wheels"
  17. redirect_to(new_services_path)
  18. else
  19. redirect_to(home_path)
  20. end
  21. end
  22. end
Runtime error #stdin #stdout #stderr 0.06s 9656KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:1:in `<main>': uninitialized constant ActionController (NameError)