Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vluzrmos
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vluzrmos/ff20d6e36e439194273a to your computer and use it in GitHub Desktop.
Save vluzrmos/ff20d6e36e439194273a to your computer and use it in GitHub Desktop.
configuração do shared listagem
<% @table_buttons.each do |button| %>
<%if button[:block].blank? or button[:block].call %>
<span class="button">
<% _button = button.dup
_button.delete(:block)
confirm = _button.delete(:confirm)
popup = _button.delete(:popup)
name = _button.delete(:name)
ajax_popup = _button.delete(:ajax_popup) %>
<% if button[:to_function] %>
<%= link_to_function name, button[:to_function], :confirm=>confirm %>
<% elsif ajax_popup %>
<%= link_to_popup(name, _button, :confirm=>confirm) %>
<% else %>
<%=(link_to name, _button, :popup => (popup)? true : false, :confirm=>confirm) %>
<% end %>
</span>
<%end%>
<% end %>
@vluzrmos
Copy link
Author

vluzrmos commented Jan 2, 2015

Adicionada opção de mensagem de confirmação

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment