Skip to content

Instantly share code, notes, and snippets.

@sfalsin
Created February 16, 2012 21:34
Show Gist options
  • Save sfalsin/1848039 to your computer and use it in GitHub Desktop.
Save sfalsin/1848039 to your computer and use it in GitHub Desktop.
Marcio Sfalsin
module ApplicationHelper
def link_to_submit(name, html_options={})
link_to_function name, ";$(this).closest('form').submit()",html_options
end
def sub_nav_fixed(&block)
content_tag('header',content_tag('div',content_tag('ul',block.call,:class=>"nav nav-pills"),:class=>"subnav subnav-fixed"),:class=>"jumbotron subhead",:id=>"overview")
end
end
<%= semantic_form_for @empresa do |f| %>
<%= render :partial=>'form', :locals=>{:f=>f} %>
<% sub_nav_fixed do %>
<li><%=link_to content_tag("b", "Empresa"), empresas_path %></li>
<li><%=link_to_submit content_tag("i", "",:class=>"icon-ok")<<" Salvar",:id=>"save"%></li>
<li><%=link_to content_tag("i", "",:class=>"icon-backward")<<' Cancelar', empresas_path,:id=>"cancel" %></li>
<li><%=link_to content_tag("i", "",:class=>"icon-minus")<<' Excluir', @empresa, :confirm => 'Deseja realmente excluir?', :method => :delete %></li>
<%end%>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment