Module: ArticlesHelper

Defined in:
app/helpers/articles_helper.rb

Instance Method Summary collapse

Instance Method Details

#highlight_new(unequal_attributes, attribute) ⇒ Object

useful for highlighting attributes, when synchronizing articles



3
4
5
6
7
# File 'app/helpers/articles_helper.rb', line 3

def highlight_new(unequal_attributes, attribute)
  return unless unequal_attributes

  unequal_attributes.has_key?(attribute) ? 'background-color: yellow' : ''
end

#row_classes(article) ⇒ Object



9
10
11
12
13
14
# File 'app/helpers/articles_helper.rb', line 9

def row_classes(article)
  classes = []
  classes << 'unavailable' unless article.availability
  classes << 'just-updated' if article.recently_updated && article.availability
  classes.join(' ')
end