2011-07-27 10 views
2

3をレールに、私はこの問題を持っている:移行した後NilClass

undefined method `reverse_merge' for nil:NilClass 

activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in `method_missing' 
actionpack (3.0.7) lib/action_controller/metal/url_for.rb:8:in `url_options' 
actionpack (3.0.7) lib/action_dispatch/routing/url_for.rb:131:in `url_for' 
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:195:in `frontend_path' 
lib/my_own_login.rb:97:in `login_required' 
activesupport (3.0.7) lib/active_support/callbacks.rb:457:in `_run__1711026059__process_action__199225275__callbacks' 
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `send' 
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks' 
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `send' 
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks' 
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action' 
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `process_action' 
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument' 

他の誰がこのエラーが発生しましたか? libに/ my_own_login.rbで

:97

if params[:mode].to_i == 1 
    redirect_to root_path 
else params[:mode].to_i == 2 
    redirect_to frontend_path #Line 97 
end 

私のroutes.rbをで

match "/account" => "account#index", :via => :get, :as => :frontend 

rake routes | grep frontend 

frontend GET /account(.:format)                 {:action=>"index", :controller=>"account"} 
+0

ルートを変更した後でアプリケーションを再起動しましたか? – nathanvda

+0

はい、私はしました。再起動したアプリ。 –

答えて

3

私はバグを修正。私はに変更

def default_url_options(options={}) 
    { :org_code => current_organisation.custom_url } if !current_organisation.blank? && !current_organisation.custom_url.blank? 
end 

def default_url_options(options={}) 
    if !current_organisation.blank? && !current_organisation.custom_url.blank? 
    { :org_code => current_organisation.custom_url } 
    else 
    {} 
    end 
end 

default_url_optionsリターンは常にハッシュしなければならない問題は、次のコードにありました。

関連する問題