1 year ago

#370481

test-img

Aman Dhruva t̠ĥǎm᷂m᷁iͮn͖a͍a̠

Is the a way to nest routes when the routes are not defined properly ruby

I want to go down a deep repository where the routes are not defined properly. with the brute fix, I can go down 2 levels.

is there a way to get access to multiple parameters and go down n levels deep.

get '/' do
  @command = Command.new

  @processes, @error, @currentFilesAndFolders, @valueTest = nil, nil, @command.exec, "GithubIntegration"


  # Render the view
  erb :index
end




get '/:id' do
  @command = Command.new
  # using nested routing system.
  # @processes, @error, @currentFilesAndFolders = @command.exec

  @currentFilesAndFolders, @valueTest = @command.NextFilesAndFolders(params[:id]), params[:id]
  # @currentFilesAndFolders = @command.NextFilesAndFolders("hi")

  erb :index
end

get '/:level/:id' do
  @command = Command.new
  # using nested routing system.
  # @processes, @error, @currentFilesAndFolders = @command.exec

  @currentFilesAndFolders, @valueTest = @command.NextFilesAndFolders(params[:level]+"/"+params[:id]), params[:id]
  # @currentFilesAndFolders = @command.NextFilesAndFolders("hi")

  erb :index
end ```


ruby-on-rails

ruby

routes

nested-routes

0 Answers

Your Answer

Accepted video resources