Module: Ems::ArticlesHelper

Defined in:
app/helpers/ems/articles_helper.rb

Instance Method Summary collapse

Instance Method Details

#allowed_statusObject

Make sure we give the user only the status that is allowed with the holding roles



13
14
15
16
17
18
19
# File 'app/helpers/ems/articles_helper.rb', line 13

def allowed_status
  status = [:draft, :pending]
  if can? :publish, @article
    status << :live
  end
  return status
end

#article_form_urlObject

create the form URL. Depends on whether or its an edit or a new



4
5
6
7
8
9
10
# File 'app/helpers/ems/articles_helper.rb', line 4

def article_form_url     
  if params[:action].eql? "edit" or params[:action].eql? "update"
    return category_article_path(@article.category, @article)
  else
    return category_articles_path(@article.category)
  end
end