lib/scaffolding_extensions/controller/camping.rb
# Defines get and post methods for the controller that
# set necessary variables and then call the correct scaffold method
Defines get and post methods for the controller that
set necessary variables and then call the correct scaffold method
Defines get and post methods for the controller that set necessary variables and then call the correct scaffold method
def scaffold_setup_helper
        include ScaffoldingExtensions::Controller
        include ScaffoldingExtensions::CampingController
        include ScaffoldingExtensions::Helper
        include ScaffoldingExtensions::CampingHelper
        define_method(:get) do |path, meth, id|
          @scaffold_request_method = 'GET'
          @scaffold_path = path
          @scaffold_method = meth.empty? ? 'index' : meth
          @scaffold_request_id = id.empty? ? nil : id
          scaffold_method_not_allowed if scaffolded_nonidempotent_method?(meth)
          send(@scaffold_method)
        end
        define_method(:post) do |path, meth, id|
          @scaffold_request_method = 'POST'
          @scaffold_path = path
          @scaffold_method = meth.empty? ? 'index' : meth
          @scaffold_request_id = id.empty? ? nil : id
          send(@scaffold_method)
        end
      end
def scaffold_setup_helper include ScaffoldingExtensions :: Controller include ScaffoldingExtensions :: CampingController include ScaffoldingExtensions :: Helper include ScaffoldingExtensions :: CampingHelper define_method ( :get ) do | path , meth , id | @scaffold_request_method = 'GET' @scaffold_path = path @scaffold_method = meth . empty? ? 'index' : meth @scaffold_request_id = id . empty? ? nil : id scaffold_method_not_allowed if scaffolded_nonidempotent_method? ( meth ) send ( @scaffold_method ) end define_method ( :post ) do | path , meth , id | @scaffold_request_method = 'POST' @scaffold_path = path @scaffold_method = meth . empty? ? 'index' : meth @scaffold_request_id = id . empty? ? nil : id send ( @scaffold_method ) end end
Defines get and post methods for the controller that
set necessary variables and then call the correct scaffold method
Defines get and post methods for the controller that set necessary variables and then call the correct scaffold method