Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

Adicionei essa span.button aí, pra o botão ficar estilizado igual aos outros

@vluzrmos
Copy link
Author

vluzrmos commented Jan 2, 2015

Adicionei block conditions

@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