Sha256: a088297ee9e9a855143b986767d3dfb80548082ccbdf4d678735946902b571ca

Contents?: true

Size: 612 Bytes

Versions: 21

Compression:

Stored size: 612 Bytes

Contents

module Ems
  module ArticlesHelper
    # create the form URL. Depends on whether or its an edit or a new
    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
    
    # Make sure we give the user only the status that is allowed with the holding roles
    def allowed_status
      status = [:draft, :pending]
      if can? :publish, @article
        status << :live
      end
      return status
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ems-0.1.12 app/helpers/ems/articles_helper.rb
ems-0.1.11 app/helpers/ems/articles_helper.rb
ems-0.1.10 app/helpers/ems/articles_helper.rb
ems-0.1.9 app/helpers/ems/articles_helper.rb
ems-0.1.8 app/helpers/ems/articles_helper.rb
ems-0.1.7 app/helpers/ems/articles_helper.rb
ems-0.1.6 app/helpers/ems/articles_helper.rb
ems-0.1.5 app/helpers/ems/articles_helper.rb
ems-0.1.4 app/helpers/ems/articles_helper.rb
ems-0.1.3 app/helpers/ems/articles_helper.rb
ems-0.1.2 app/helpers/ems/articles_helper.rb
ems-0.1.1 app/helpers/ems/articles_helper.rb
ems-0.1.0 app/helpers/ems/articles_helper.rb
ems-0.0.9 app/helpers/ems/articles_helper.rb
ems-0.0.8 app/helpers/ems/articles_helper.rb
ems-0.0.7 app/helpers/ems/articles_helper.rb
ems-0.0.6 app/helpers/ems/articles_helper.rb
ems-0.0.5 app/helpers/ems/articles_helper.rb
ems-0.0.4 app/helpers/ems/articles_helper.rb
ems-0.0.3 app/helpers/ems/articles_helper.rb