blazer icon indicating copy to clipboard operation
blazer copied to clipboard

Routing issue

Open badogar opened this issue 8 years ago • 3 comments

Hi,

First of all, thank you for writing such an amazing gem, as per documentation and examples provided it looks awesome. I was trying to hook it up in our app (want to give prototype to my team before jumping deep into it) but unfortunately routes are not working properly. e.g., instead of this /blazer/queries/new what I am getting is /blazer/assets?action=new&controller=blazer%2Fqueries and as soon as I changed it manually to how it should be, that page works.
This is how rake routes show all the paths...

   cancel_queries POST   /queries/cancel(.:format)         blazer/queries#cancel
    refresh_query POST   /queries/:id/refresh(.:format)    blazer/queries#refresh
   tables_queries GET    /queries/tables(.:format)         blazer/queries#tables
   schema_queries GET    /queries/schema(.:format)         blazer/queries#schema
          queries GET    /queries(.:format)                blazer/queries#index
                  POST   /queries(.:format)                blazer/queries#create
        new_query GET    /queries/new(.:format)            blazer/queries#new
       edit_query GET    /queries/:id/edit(.:format)       blazer/queries#edit
            query GET    /queries/:id(.:format)            blazer/queries#show
                  PATCH  /queries/:id(.:format)            blazer/queries#update
                  PUT    /queries/:id(.:format)            blazer/queries#update
                  DELETE /queries/:id(.:format)            blazer/queries#destroy
        run_check GET    /checks/:id/run(.:format)         blazer/checks#run
           checks GET    /checks(.:format)                 blazer/checks#index
                  POST   /checks(.:format)                 blazer/checks#create
        new_check GET    /checks/new(.:format)             blazer/checks#new
       edit_check GET    /checks/:id/edit(.:format)        blazer/checks#edit
            check PATCH  /checks/:id(.:format)             blazer/checks#update
                  PUT    /checks/:id(.:format)             blazer/checks#update
                  DELETE /checks/:id(.:format)             blazer/checks#destroy
refresh_dashboard POST   /dashboards/:id/refresh(.:format) blazer/dashboards#refresh
       dashboards GET    /dashboards(.:format)             blazer/dashboards#index
                  POST   /dashboards(.:format)             blazer/dashboards#create
    new_dashboard GET    /dashboards/new(.:format)         blazer/dashboards#new
   edit_dashboard GET    /dashboards/:id/edit(.:format)    blazer/dashboards#edit
        dashboard GET    /dashboards/:id(.:format)         blazer/dashboards#show
                  PATCH  /dashboards/:id(.:format)         blazer/dashboards#update
                  PUT    /dashboards/:id(.:format)         blazer/dashboards#update
                  DELETE /dashboards/:id(.:format)         blazer/dashboards#destroy
             root GET    /                                 blazer/queries#home```

Rails: 4.2.10
Ruby: 2.3.0

It is highly likely that it has some issues with our codebase, as I couldn't find any such stuff in search. Any help would be highly appreciated. 

Thanks

badogar avatar Jun 13 '18 14:06 badogar

Hey @badogar, can't recall seeing this before unfortunately. It seems like an issue specific to your app, so not sure there's much I can do to help.

ankane avatar Jun 29 '18 06:06 ankane

Same problem

Pazzik avatar Nov 19 '20 10:11 Pazzik

Posted the fix here: https://github.com/ankane/blazer/issues/191#issuecomment-734315482

BrianSigafoos avatar Nov 26 '20 14:11 BrianSigafoos