Sha256: 455097a7c1b1eadc15b8fd7fa1a2097773a95d9ac8f29db3ce3d056a5d52511f

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

module AgilideeCommons
  module ContextHelper
    def context_icon(id)
      icon(id)
    end
    
    def context_title(title)
      content_tag(:h2){ title }
    end
    
    def context_info(name, info)
      return if info.blank?
      %(<p class="infos"><strong>#{name} : </strong>#{info}</p>).html_safe
    end
    
    def actions_for(obj, opts={})
      url        = opts[:url]
      edit_url   = opts[:edit_url]
      delete_url = opts[:delete_url]
      
      url        = polymorphic_path(obj) if url.nil?
      edit_url   = url + "/edit"         if edit_url.nil?
      delete_url = url                   if delete_url.nil?
      
      render partial: "agilidee_commons/actions", locals: {
        :obj        => obj,
        :url        => url,
        :edit_url   => edit_url,
        :delete_url => delete_url,
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
agilidee_commons-1.0.3 app/helpers/agilidee_commons/context_helper.rb