Sha256: a326fc805a0d25bfcf8e99380371d9e1430b7001f6370158685a65036a321692
Contents?: true
Size: 1.98 KB
Versions: 10
Compression:
Stored size: 1.98 KB
Contents
<% url_options ||= params_for(:action => form_action) xhr = request.xhr? if xhr.nil? if active_scaffold_config.actions.include? form_action multipart ||= active_scaffold_config.send(form_action).multipart? columns ||= if respond_to?("#{form_action}_columns") self.send("#{form_action}_columns") else active_scaffold_config.send(form_action).columns end else multipart ||= false columns ||= nil end body_partial ||= 'form' %> <%= options = {:onsubmit => onsubmit, :id => element_form_id(:action => form_action), :multipart => multipart, :class => "as_form #{form_action.to_s}", :method => method, 'data-loading' => true, 'data-as_load' => 'form', 'data-as_action' => form_action } cancel_options = {:class => 'as_cancel', 'data-refresh' => false} cancel_options[:remote] = true if xhr #cancel link does nt have to care about multipart forms if xhr && multipart # file_uploads form_remote_upload_tag url_options.merge({:iframe => true}), options else options[:remote] = true if xhr && !multipart form_tag url_options, options end -%> <h4><%= headline -%></h4> <div id="<%= element_messages_id(:action => form_action) %>" class="messages-container"> <% if request.xhr? -%> <% records = @error_records || Array(@record) records.each do |record| %> <%= active_scaffold_error_messages_for record, :object_name => "#{record.class.model_name.human.downcase}#{record.new_record? ? '' : ": #{record.to_label}"}" %> <% end %> <% else -%> <%= render :partial => 'form_messages' %> <% end -%> </div> <%= render :partial => body_partial, :locals => { :columns => columns } %> <p class="form-footer"> <%= submit_tag as_(form_action), :class => "submit" %> <%= link_to(as_(:cancel), main_path_to_return, cancel_options) if cancel_link %> <%= loading_indicator_tag(:action => form_action, :id => params[:id]) %> </p> </form>
Version data entries
10 entries across 10 versions & 1 rubygems