module Spyro::ActionViewExtension::BasicWidgetsHelper

Public Instance Methods

alert(text, options = {}) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 53
def alert text, options = {}
  @has_alert = true
  options[:class] ||= ['alert']
  capture_haml do
    haml_tag :div, options do
      haml_concat text
    end
  end
end
button(name, link, options = {}) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 25
def button name, link, options = {}
  @has_button = true
  options[:class] ||= ['btn btn-default']
  text = ""
  text = I18n.t("#{params[:controller].gsub('/', '.')}.#{params[:action]}.button.#{name.downcase}", :default => I18n.t("scaffold.buttons.#{name.downcase}", :default => name.to_s.humanize)) unless name.blank?
  text = "<span class='glyphicon glyphicon-#{options[:icon]}'></span>#{text}".html_safe if options[:icon]
  link_to text, link, options
end
group(&block) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 44
def group &block
  @has_group = true
  capture_haml do
    haml_tag :div, :class => ['btn-group'] do
      haml_concat capture(&block)
    end
  end
end
mini_button(name, link, options = {}) click to toggle source
# File lib/spyro/helpers/action_view_extension.rb, line 11
def mini_button name, link, options = {}
  options[:class] = (options[:class] || []) + ['btn-xs', 'btn', 'btn-default']
  button name, link, options
end