Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routes.rb remains same during Install #53

Closed
ZirconCode opened this issue May 10, 2014 · 3 comments
Closed

routes.rb remains same during Install #53

ZirconCode opened this issue May 10, 2014 · 3 comments

Comments

@ZirconCode
Copy link
Contributor

When running rails g koudoku:install user, somehow the engine isn't being mounted. All paths fail, and the routes.rb file hasn't changed. The gsub is run during the installation process however, as I do get the line:

gsub config/routes.rb

Could it be that the regex in install_generator.rb is wrongly capitalized?

/Application.routes.draw do/ -> /application.routes.draw do/

I am on rails 4.1.

@ZirconCode
Copy link
Contributor Author

So after some more searching, this is a change which happened in rails 4.

I goes from ApplicationName::Application.routes.draw do to Rails.application.routes.draw do

Sent a pull request with the regex fix =)

@yas4891
Copy link
Collaborator

yas4891 commented Oct 15, 2014

Hi @ZirconCode,

Thanks a lot for your contribution, we really appreciate it.

I updated the code with a more robust route instead of gsub_file and will now close this issue.

Cheers,
Christoph

@yas4891 yas4891 closed this as completed Oct 15, 2014
@george-carlin
Copy link
Contributor

Note to anybody coming here from Google: if you're having this same issue (like I was), be aware that version 0.0.11 of koudoku (the latest version on Rubygems) doesn't include this fix - so if you have gem 'koudoku' in your Gemfile, it won't work. Use the master branch from Github instead: gem 'koudoku', github: 'andrewculver/koudoku' (or better yet, fork the Github repo and point your Gemfile towards your own copy, so your app won't be broken by stray commits to the master branch.)

OR if you just want to know what code you're missing, here's what you need to add to config/routes.rb:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants