OMG so simple, in fact subtle ! How i could miss that? Well, thanks for the help Kevin.
But now i have another problem. Because i have an ajax filter dependent drop downs (implemented like described - http://cookbook.hobocentral.net/recipes/33-ajax-filtering-on-a-partially-completed) i got another error :( ActionController::UnknownAction (No action responded to 1-ev-lus. Actions: access_denied, authenticated_user_from_cookie, authorized?, call_rake, create, create_auth_cookie, destroy, edit, index, login_from_cookie, login_required, model, new, redirect_back_or_default, show, store_location, and update): /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:617:in `call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:638:in `run_before_filters' /Library/Ruby/Gems/1.8/gems/hobo-0.8.5/lib/hobo/controller.rb: 22:in `call' /Library/Ruby/Gems/1.8/gems/hobo-0.8.5/lib/hobo/controller.rb: 22:in `included_in_class' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ callbacks.rb:182:in `call' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ callbacks.rb:182:in `evaluate_method' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:184:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:635:in `run_before_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:615:in `call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:610:in `perform_action_without_benchmark' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ benchmarking.rb:68:in `perform_action_without_rescue' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/benchmark.rb:293:in `measure' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ benchmarking.rb:68:in `perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ rescue.rb:136:in `perform_action_without_caching' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ caching/sql_cache.rb:13:in `perform_action' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:34:in `cache' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ query_cache.rb:8:in `cache' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ caching/sql_cache.rb:12:in `perform_action' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ base.rb:524:in `send' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ base.rb:524:in `process_without_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ filters.rb:606:in `process_without_session_management_support' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ session_management.rb:134:in `process' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ base.rb:392:in `process' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:183:in `handle_request' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:110:in `dispatch_unlocked' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:123:in `dispatch' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:122:in `synchronize' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:122:in `dispatch' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:132:in `dispatch_cgi' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ dispatcher.rb:39:in `dispatch' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:76:in `process' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:74:in `synchronize' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:74:in `process' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:282:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `each' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 128:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel/ command.rb:212:in `run' /Users/damx/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:142:in `load_without_new_constant_marking' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:142:in `load' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:521:in `new_constants_in' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:142:in `load' /Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/commands/servers/ mongrel.rb:64 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:153:in `require' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:521:in `new_constants_in' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:153:in `require' /Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' script/server:3 Rendering /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/templates/rescues/layout.erb (not_found) And i dont have a clue why... Any ideas. Thank you once again. On Dec 7, 6:03 pm, kevinpfromnm <[email protected]> wrote: > Try hobo_create_for :imovel > > On Dec 7, 12:54 am, Daniel M <[email protected]> wrote: > > > > > I also have these new_for and edit_for set: > > > def new_for_builinding > > hobo_new_for :builinding do > > this.attributes = params[:address] || {} > > hobo_ajax_response if request.xhr? > > end > > end > > > def edit_for_builing > > hobo_edit_for :builinding do > > this.attributes = params[:address] || {} > > hobo_ajax_response if request.xhr? > > end > > end > > > But with this: > > > def create_for_imovel > > �...@cont= Address.new(params[:address]) > > if @cont.save > > flash[:notice] = "Address saved sucessfully" > > respond_to do |format| > > format.html { redirect_to building_path(@cont.building.id) if > > valid? } > > format.js > > end > > else > > hobo_create > > end > > end > > > The result its the same, it fails :( > > > On Dec 7, 1:43 am, kevinpfromnm <[email protected]> wrote: > > > > what happens if you drop the block to hobo_create and just leave it > > > vanilla hobo? > > > > On Dec 6, 4:43 pm, Daniel M <[email protected]> wrote: > > > > > Sorry, translation problems...here its the actually correct one > > > > > def create_for_imovel > > > > �...@cont= Address.new(params[:address]) > > > > if @cont.save > > > > flash[:notice] = "Address saved sucessfully" > > > > respond_to do |format| > > > > format.html { redirect_to building_path(@cont.building.id) if > > > > valid? } > > > > format.js > > > > end > > > > else > > > > hobo_create do > > > > this.attributes = params[:address] || {} > > > > hobo_ajax_response if request.xhr? > > > > end > > > > end > > > > end > > > > > Any ideas about what its missing? > > > > Thank you. > > > > > On Dec 6, 11:40 pm, Daniel M <[email protected]> wrote: > > > > > > My controller has the following controller (extend because ajax > > > > > porpuses) > > > > > > def create_for_imovel > > > > > �...@cont= Address.new(params[:address]) > > > > > if @cont.save > > > > > flash[:notice] = "Address saved sucessfully" > > > > > respond_to do |format| > > > > > format.html { redirect_to building_path(@cont.building.id) if > > > > > valid? } > > > > > format.js > > > > > end > > > > > else > > > > > > hobo_create do > > > > > this.attributes = params[:morada] || {} > > > > > hobo_ajax_response if request.xhr? > > > > > end > > > > > end > > > > > end > > > > > > Thankz > > > > > > On Dec 6, 11:29 pm, Daniel M <[email protected]> wrote: > > > > > > > Hi all. > > > > > > > I have the following (simplified) model: > > > > > > > class Address < ActiveRecord::Base > > > > > > hobo_model # Don't put anything above this > > > > > > fields do > > > > > > street :string > > > > > > nr :string > > > > > > floor :integer > > > > > > postal_code :integer > > > > > > latitude :string > > > > > > longitude :string > > > > > > timestamps > > > > > > end > > > > > > > belongs_to :person > > > > > > belongs_to :building > > > > > > belongs_to :apartment > > > > > > > belongs_to: city > > > > > > belongs_to: country > > > > > > > validates_presence_of :city > > > > > > > end > > > > > > > When i create one address for a building, everything goes, ok, the > > > > > > new > > > > > > form its rendered (ok) with the title: > > > > > > > New Address > > > > > > > For: Building One > > > > > > > But if i create the building without a city, validation fails and > > > > > > it's > > > > > > rendered : > > > > > > > New Address > > > > > > > For: (Not Available) > > > > > > > To proceed please correct the following: > > > > > > > City can't be blank > > > > > > > That means that some how the belongs_to its lost and i dont know how > > > > > > to recover the belongs_to context... > > > > > > > Any ideas? > > > > > > Thanks in advance. > > > > > > > Ps: hobo version - 0.8.5 -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
