Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CamelCase = Regexp.new( '\b((?:[A-Z]\w+){2,})' )
- def index
- @page = Page.find_by_name(params[:name] || 'FrontPage')
- @page.content.gsub!( CamelCase, '<a href="/wiki/\1">\1</a>' )
- if @page.nil?
- redirect_to( :action => 'edit', :name => params[:name] )
- else
- @page.content.gsub!( CamelCase, '<a href="/wiki/\1">\1</a>' )
- end
- end
Add Comment
Please, Sign In to add comment