lib/extensions/action_dispatch/routing/mapper.rb
def draw_sub_pages
        files = Dir["#{Rails.root.join('app', 'views', 'pages')}/*"]
        directories = files.select {|file| File.directory? file }
        directories.each do |directory|
          directory_name = File.basename(directory)
          draw_routes(directory_name)
          generate_controller(directory_name)
        end
      end
# Draws the routes for static pages within sub folders.
# Any .html.erb file in a folder within `app/views/pages` will be served as
# the dasherized folder name and file name.
# @example
#   about_us/team.html.erb will be served at http:/example/about-us/team
#   and the link helper will be available as `about_us_team_path`
Draws the routes for static pages within sub folders.
Any .html.erb file in a folder within `app/views/pages` will be served as
the dasherized folder name and file name.
Draws the routes for static pages within sub folders . Any . html . erb file in a folder within ` app / views / pages ` will be served as the dasherized folder name and file name .
def draw_sub_pages
        files = Dir["#{Rails.root.join('app', 'views', 'pages')}/*"]
        directories = files.select {|file| File.directory? file }
        directories.each do |directory|
          directory_name = File.basename(directory)
          draw_routes(directory_name)
          generate_controller(directory_name)
        end
      end
def draw_sub_pages files = Dir [ "#{Rails.root.join('app', 'views', 'pages')}/*" ] directories = files . select { | file | File . directory? file } directories . each do | directory | directory_name = File . basename ( directory ) draw_routes ( directory_name ) generate_controller ( directory_name ) end end
Draws the routes for static pages within sub folders.
Draws the routes for static pages within sub folders .
example
about_us/team.html.erb will be served at http:/example/about-us/team and the link helper will be available as `about_us_team_path`
about_us / team . html . erb will be served at http : / example / about - us / team and the link helper will be available as ` about_us_team_path `