1

Setuping a staticMatic project using /index.html:

@slug = current_page.gsub(/\.html/, '')

returns "/index(.html)", but should be /index


Changing term corrects: - @slug = current_page.gsub("/", "").gsub(".html", "") as found in:

https://github.com/adamstac/staticmatic-bootstrap/blob/master/src/helpers/application_helper.rb

kaichanvong
  • 381
  • 3
  • 12

1 Answers1

1

To delete the beginning "/" after you've stripped the html simply execute this (which will do both in one command):

current_page.gsub(/\.html/, '').gsub(/\//,''))
ennuikiller
  • 46,381
  • 14
  • 112
  • 137
  • Thanks! I also discovered this, when changing my search terms more and more: - @slug = current_page.gsub("/", "").gsub(".html", "") It was in - http://github.com/adamstac/staticmatic-bootstrap – kaichanvong Aug 08 '10 at 22:26