sy ingin tanya, kenapa mas Firman ingin me load seluruh helper di application.rb ?
apakah tidak ada jalan lain sehingga ingin me-load seluruh helper sehingga available di seluruh controller ? dan lagian seluruh model bisa langsung diakses diseluruh app tanpa perlu di load secara ekplisit On Wed, Dec 3, 2008 at 4:50 PM, firman syah <[EMAIL PROTECTED]> wrote: > Mas2... > mo tanya, kalau preloaded class taruhnya dimana? > saya coba masukin di bawah model, trus diload sebagai module di application > controller. Ternyata malah error. > > ./app/models: > cart.rb item.rb purchase.rb > > application.rb: > class ApplicationController < ActionController::Base > helper :all # include all helpers, all the time > model :cart > model :purchase > ..... > > error: > => Booting WEBrick... > /~home/Rails/store/app/controllers/application.rb:6: undefined method > `model' for ApplicationController:Class (NoMethodError) > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:216:in > `load_without_new_constant_marking' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:216:in > `load_file' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in > `new_constants_in' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:215:in > `load_file' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:96:in > `require_or_load' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:61:in > `depend_on' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:457:in > `require_dependency' > from > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:18:in > `define_dispatcher_callbacks' > ... 25 levels... > from > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:39 > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from script/server:3 > > thanks.. :) > > [Non-text portions of this message have been removed] > > -- blog : http://adityakircon.blogsome.com ym : adit.prawirasoft skype : adit_skype i continue to fight, i continue to FIGHT (O2 - Orange Range)