Forum: Ruby on Rails Creating and managing Rails routes on the fly

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0ac82f4ddda697b8bb0453ae582fb4d3?d=identicon&s=25 Martin (Guest)
on 2005-12-15 15:52
Here is what I'd like to be able to do:

I want to be able administer routes using a rails application. So an
interface
would list routes and give users the ability to manage these on the fly:


class RoutesController < ApplicationController
  # very simple example

  def add
     ...
     Routes.connect 'customurl', :controller => "customcontroller",
:controller => "customaction"
     Routes.save # save user created routes back to routes.rb file or
some other storage mechanism
      ...
  end

  def list
      @allroutes = Routes.find(:all)
  end


end

Is this possible?

Ideally what is required is direct access to
ActionController::Routing::Routes
in the ApplicationController if this can be achieved?


Any help much appreciated,
Thanks,
Martin.
This topic is locked and can not be replied to.