app/models/styleus/view_component.rb in styleus-0.0.4 vs app/models/styleus/view_component.rb in styleus-0.0.5
- old
+ new
@@ -1,13 +1,17 @@
module Styleus
class ViewComponent < Styleus::Base
- with_attributes :headline, :partial_path
+ with_attributes :headline, :partial_path, :helper
# id is used as anchor id in the anchor menu,
# so it has to be a uid.
# TODO: make sure the uid-ness :)
def id
- headline.underscore
+ headline.underscore.gsub(/ /, '_')
+ end
+
+ def helper?
+ !!helper
end
class << self
def components
@components ||= []
\ No newline at end of file