Module: AgilideeCommons::ContextHelper
- Defined in:
- app/helpers/agilidee_commons/context_helper.rb
Instance Method Summary collapse
- #actions_for(obj, opts = {}) ⇒ Object
- #context_icon(id) ⇒ Object
- #context_info(name, info) ⇒ Object
- #context_title(title) ⇒ Object
- #render_contextual ⇒ Object
Instance Method Details
#actions_for(obj, opts = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/agilidee_commons/context_helper.rb', line 16 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 |
#context_icon(id) ⇒ Object
3 4 5 |
# File 'app/helpers/agilidee_commons/context_helper.rb', line 3 def context_icon(id) icon(id) end |
#context_info(name, info) ⇒ Object
11 12 13 14 |
# File 'app/helpers/agilidee_commons/context_helper.rb', line 11 def context_info(name, info) return if info.blank? %(<p class="infos"><strong>#{name} : </strong>#{info}</p>).html_safe end |
#context_title(title) ⇒ Object
7 8 9 |
# File 'app/helpers/agilidee_commons/context_helper.rb', line 7 def context_title(title) content_tag(:h2){ title } end |
#render_contextual ⇒ Object
33 34 35 |
# File 'app/helpers/agilidee_commons/context_helper.rb', line 33 def render_contextual render "agilidee_commons/contextual" end |