Sha256: b2051c19245a7df863613e58f916cda3a5d267640b7ef2e52a3d2b7678bf1e0c
Contents?: true
Size: 1.38 KB
Versions: 13
Compression:
Stored size: 1.38 KB
Contents
module Spurs module Modal module ControllerMods extend ActiveSupport::Concern def spawn_form_modal(title, partial, object, options={ }) opts = { :actions => [ { :name => :cancel, :position => :left, :action => :close_modal, :class => "btn-large" }, { :name => :save, :position => :right, :action => :submit_form_and_close_modal, :class => "btn-primary btn-large" }, ] }.merge(options) spawn_modal(title, partial, object, opts) end def spawn_close_modal(title, file, options={ }) opts = { :actions => [ { :name => :cancel, :position => :left, :action => :close_modal, :class => "btn-large" } ] }.merge(options) spawn_modal(title, file, nil, opts) end def spawn_modal(title, partial, object, options={ }) opts = { :header => { :title => title.titlecase, :icon => options[:title_icon] ? options.delete(:title_icon) : nil }, }.merge(options) render :file => "spurs/modals/spawn", :locals => { :modal_file_or_partial => partial, :modal_object => object, :modal_options => opts } end end end end
Version data entries
13 entries across 13 versions & 1 rubygems