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

paths incorrect? #62

Open
keenahn opened this issue Dec 3, 2014 · 8 comments
Open

paths incorrect? #62

keenahn opened this issue Dec 3, 2014 · 8 comments

Comments

@keenahn
Copy link

keenahn commented Dec 3, 2014

Hi Gavin, great gem. Thanks for maintaining this. I'm using rails 3.2

I'm trying to add it to my existing project. I did the installation properly as detailed in the README. I have added

mount Blogit::Engine => "/blog", as: :blogit

to my routes.rb

When I go to "/blog" on my development server, the link to the "New Blog Post" is:

http://xxxx/blog/assets?action=new&controller=blogit%2Fposts and thus errors out

When I go to http://xxxx/blog/posts/new directly, I see the form, but the form action is

/blog/assets?controller=blogit%2Fposts

I think I'm not understanding something about mounting Engines and how they affect paths. Do you have any ideas? Thanks a lot

@keenahn keenahn changed the title path helpers not working? paths incorrect? Dec 3, 2014
@Bodacious
Copy link
Owner

@keenahn very unusual - which version of Rails and Blogit are you using?

@keenahn
Copy link
Author

keenahn commented Dec 3, 2014

blogit (0.8.0)
rails (3.2.17)

I tried removing everything from my routes file except for that, and it did the same thing.

@Bodacious
Copy link
Owner

Can you paste the relevant parts of the output from
$ rake routes

@keenahn
Copy link
Author

keenahn commented Dec 3, 2014

blogit        /blog                                            Blogit::Engine
...
Routes for Blogit::Engine:
                         /posts/page/:page(.:format)            blogit/posts#index
tagged_blog_posts        /posts/tagged/:tag(.:format)           blogit/posts#tagged
    post_comments POST   /posts/:post_id/comments(.:format)     blogit/comments#create
     post_comment DELETE /posts/:post_id/comments/:id(.:format) blogit/comments#destroy
            posts GET    /posts(.:format)                       blogit/posts#index
                  POST   /posts(.:format)                       blogit/posts#create
         new_post GET    /posts/new(.:format)                   blogit/posts#new
        edit_post GET    /posts/:id/edit(.:format)              blogit/posts#edit
             post GET    /posts/:id(.:format)                   blogit/posts#show
                  PUT    /posts/:id(.:format)                   blogit/posts#update
                  DELETE /posts/:id(.:format)                   blogit/posts#destroy
        blog_root        /                                      blogit/posts#index

Hey, thanks a lot Gavin. I really appreciate your help! It's not that many people who would be so responsive on an open source gem :)

@Bodacious
Copy link
Owner

@keenahn Sorry, I lost track of this issue.

Did you ever resolve it?

@rperez14
Copy link

I am having this issue as well :-(

@archonic
Copy link

archonic commented Mar 7, 2020

I'm having exactly the same issue (6 years later!) but with a completely different gem (Blazer). Sorry to revive a dead thread but does anyone know why engine routes output /assets?action=new&controller=...?

@Bodacious
Copy link
Owner

@archonic Can you please provide the following:

  • Output of bundle list
  • Contents of your routes.rb file
  • Output of rails routes

Thanks!

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

4 participants