Show value of formula with Spreadsheet gem in Rails
I am trying to show an excel spreadsheet inside a RoR application. I started using the Spreadsheet gem, which works wonderfully. However, when I don't know how to show a cell which has a formu开发者_JS百科la (I want to show the resulting value). There is a Spreadsheet::Formula class which has a value method that seems for that, but I don't know how to instantiate or use this class. Any help will be appreciated.
Silly me. Just use the value method on the cell :-)
sheet = book.worksheet 0
sheet[1,2].value
精彩评论