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

No routes generated #2

Open
polyglotdev opened this issue Nov 5, 2022 · 11 comments
Open

No routes generated #2

polyglotdev opened this issue Nov 5, 2022 · 11 comments

Comments

@polyglotdev
Copy link

Just wondering if I am missing something because I have routes in my routes.rb, but none show in extention tab?

@makicamel
Copy link
Owner

Thank you for your report!
Do you have any error messages like:

@polyglotdev
Copy link
Author

Nothing generated as an error but I will see whats in the console for VS Code in the AM

@polyglotdev
Copy link
Author

polyglotdev commented Nov 8, 2022

This is the error in developer tools in VS Code 👇🏾

Refused to load the script 'vscode-resource:/Users/dom-hashicorp/.vscode-insiders/extensions/makicamel.rails-routes-navigator-0.1.0/media/script.js' because it violates the following Content Security Policy directive: "script-src 'self' https://*.vscode-cdn.net 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

@polyglotdev
Copy link
Author

rails-routes-vscode

That's what did render 👆🏾 in VS Code

@andyjeffries
Copy link

I get exactly the same as @polyglotdev above (and have done for a while).

@eljuanchosf
Copy link

Hello @makicamel ! Thank you for this extension. I'm currently seeing the same problem as @andyjeffries. Is there any chance you can get to it at anytime? Thank you!

@joevin-slq-docto
Copy link

Many many cases are not handled in the parse function of routes.ts.
Regex must be more refined like in this extension : https://github.com/basgren/railways/blob/master/src/net/bitpot/railways/parser/RailsRoutesParser.java. For example, if you have any route that uses redirect(), it will crash.

@andyjeffries
Copy link

I get the same thing on a fairly new Rails 7.1 app that has a pretty minimal routes.rb file.

Rails.application.routes.draw do
  # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

  # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
  # Can be used by load balancers and uptime monitors to verify that the app is live.
  get "up" => "rails/health#show", as: :rails_health_check

  get "login" => "sessions#new", as: :login
  post "login" => "sessions#create"
  delete "logout" => "sessions#destroy", as: :logout

  resource :budget
  resources :groups
  resources :categories # may not be needed
  resources :period_categories
  resources :investments
  resources :debts
  resource :net_worth
  resources :transactions
  resources :settings

  # Defines the root path route ("/")
  root "budget#index"
end

@andyjeffries
Copy link

From a brief look at the code, it appears to be that it really doesn't support Rails restful resources. I tried to change the code to use "bundle exec rails routes -E" which gives a more parseable output of all generated routes but I'm really nowhere near experienced enough in TypeScript or VSCode extensions to debug it enough.

@MrKirat
Copy link

MrKirat commented Dec 15, 2023

rails-routes-vscode

That's what did render 👆🏾 in VS Code

Same here

@heyitscoco
Copy link

fwiw I'm having the same problem still :/

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

7 participants