Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application Helper Methods Availability

I am using Rails 4 and am trying to include the koudoku stripe gem. Here is my routes:

# Added by Koudoku.
mount Koudoku::Engine, at: 'koudoku'
scope module: 'koudoku' do
    get 'pricing' => 'subscriptions#index', as: 'pricing'
end

resource :account

devise_for :users, :skip => [:sessions]
as :user do
    get '/login' => 'devise/sessions#new', :as => :new_user_session
    post '/login' => 'devise/sessions#create', :as => :user_session
    get '/logout' => 'devise/sessions#destroy', :as => :destroy_user_session
end

get '/dashboard', to: 'dashboard#index'
get '/reports/generate', to: 'reports#generate'

authenticated :user do
    root :to => 'dashboard#index', :as => :authenticated_root
end

root :to => redirect('/login')

And this is the error I am getting:

undefined local variable or method `root_url

I can access the other routes just fine, it is just trying to render the Application Helper methods (for instance, a custom app method I have defined, or routes methods) from the module routes... Does this make sense? How do I fix this?

like image 369
Jonathan Reyes Avatar asked Jul 07 '26 11:07

Jonathan Reyes


1 Answers

Try adding "main_app." before your root path. For example:

main_app.root_path
like image 154
user2270029 Avatar answered Jul 09 '26 00:07

user2270029



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!