Sha256: e5b19e97890320954474e9e5a1ca3cfc8dae31fa71fdb9fedbaaf6a1cb824580

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

<%
  column = if render_field.is_a? ActiveScaffold::DataStructures::Column
    render_field
  else
    active_scaffold_config.columns[render_field.to_sym]
  end
  return unless @main_columns.include? column.name
  @rendered ||= Set.new
  return if @rendered.include? column.name
  @rendered << column.name
  if column_renders_as(column) == :subform
    options = {:is_subform => true, :field_class => "#{column.name}-sub-form"}
  else
    options = {:is_subform => false, :field_class => "#{column.name}-input"}
  end
  html = if scope
    readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update))
    crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
    active_scaffold_render_subform_column(column, scope, crud_type, readonly, !active_scaffold_config.subform.columns.names_without_auth_check.include?(column.name))
  else
    render(:partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope })
  end
-%>

ActiveScaffold.render_form_field('<%= source_id %>','<%= escape_javascript(html) %>', <%= options.to_json.html_safe %>);
<%if column.update_columns && !column.update_columns.empty?%>
  <%=  render(:partial => "render_field", :collection => column.update_columns, :locals => {:source_id => source_id, :scope => scope})%>
<%end%>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_scaffold-3.3.0.rc3 app/views/active_scaffold_overrides/_render_field.js.erb
active_scaffold-3.3.0.rc2 app/views/active_scaffold_overrides/_render_field.js.erb
active_scaffold-3.3.0.rc app/views/active_scaffold_overrides/_render_field.js.erb