Advertisement
Guest User

Untitled

a guest
May 4th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Including modules and classes in rails
  2. module TwitterPost
  3. include ActionView::Helpers::NumberHelper
  4.  
  5. def update
  6. number_with_delimiter(1234567)
  7. end
  8. end
  9.  
  10. NoMethodError: undefined method `number_with_delimiter' for TwitterPost:Module
  11.  
  12. module TwitterPost
  13. include ActionView::Helpers::NumberHelper
  14.  
  15. def update
  16. number_with_delimiter(1234567)
  17. end
  18. end
  19.  
  20. class Foo
  21. include TwitterPost
  22. end
  23.  
  24. foo = Foo.new
  25. foo.update
  26. => "1,234,567"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement