engines/adva_cms/lib/routing_filter/section_root.rb
def around_generate(*args, &block)
      returning yield do |result|
        result = result.first if result.is_a?(Array)
        if result !~ %r(^/admin/) and result =~ generate_pattern
          segments, section_type, section_id, dot_or_dash = $2, $3, $4, $5
          section = Section.find(section_id.to_i)
          if section and section.root_section?
            result.sub! segments, dot_or_dash unless dot_or_dash == '.'
            result.replace '/' if result.empty?
          end
        end
      end
    end
# prepends the root section path to the path if the given pattern matches
prepends the root section path to the path if the given pattern matches
prepends the root section path to the path if the given pattern matches
def around_generate(*args, &block)
      returning yield do |result|
        result = result.first if result.is_a?(Array)
        if result !~ %r(^/admin/) and result =~ generate_pattern
          segments, section_type, section_id, dot_or_dash = $2, $3, $4, $5
          section = Section.find(section_id.to_i)
          if section and section.root_section?
            result.sub! segments, dot_or_dash unless dot_or_dash == '.'
            result.replace '/' if result.empty?
          end
        end
      end
    end
def around_generate ( * args , & block ) returning yield do | result | result = result . first if result . is_a? ( Array ) if result !~ %r( ^/admin/ ) and result =~ generate_pattern segments , section_type , section_id , dot_or_dash = $2 , $3 , $4 , $5 section = Section . find ( section_id . to_i ) if section and section . root_section? result . sub! segments , dot_or_dash unless dot_or_dash == '.' result . replace '/' if result . empty? end end end end
prepends the root section path to the path if the given pattern matches
prepends the root section path to the path if the given pattern matches
args
block