fixed toolbar helper

This commit is contained in:
Andreas Stephanides
2013-03-19 04:58:53 +01:00
parent a712fc70f4
commit 744fcfddb4
3 changed files with 7 additions and 4 deletions

View File

@@ -20,7 +20,9 @@ class StudienController < ApplicationController
modulgruppen =[]
modulgruppen_phase.each_slice(opts[:slice]) do |s| modulgruppen<<s end
@studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts)
toolbar_elements=[ link_to('<i class="icon-plus"'.html_safe + I18n.t('studien.new') , new_modul_path)]
@toolbar_elements=[{:text => '<i class="icon-plus"></i> '.html_safe + I18n.t('studien.new') , :path => new_modul_path() }]
@toolbar_elements<<{:text => '<i class="icon-pencil"></i> '.html_safe + I18n.t('common.edit'),:path=>edit_studium_path(@studium)}
#@toolbar_elements<<{:text ='<i class="icon-cross"></i> '.html_safe +I18n.t('common.delete'),path => delete_studium_path(@studium)}
end
end

View File

@@ -9,7 +9,7 @@ module ApplicationHelper
def toolbar_html(elemente)
html = ""
elemente.each do |e|
html =html + e + " | "
html = html + link_to(e[:text],e[:path]) + " | "
end
#html= html + "</ul>"
raw(html)

View File

@@ -25,8 +25,9 @@
<%= link_to '<i class="icon-plus-sign"></i>'.html_safe+I18n.t("studien.newmodulgroup"), new_studium_modulgruppe_path(@studium),:class=>"btn" %> |
<%= link_to '<i class="icon-pencil"></i>'.html_safe+I18n.t("common.edit"), edit_studium_path(@studium) ,:class=>"btn"%>
<%= link_to 'Destroy', @studium, method: :delete, data: { confirm: 'Are you sure?' } %>
<%= toolbar_html(toolbar_elements) %>
</span>
</div>
</div>
<%= toolbar_html(@toolbar_elements) %>