lib/scaffolding_extensions/helper.rb
# An html fragment with all of the given fields for @scaffold_object, suitable for
# inclusion in a form tag
An html fragment with all of the given fields for @scaffold_object, suitable for
inclusion in a form tag
An html fragment with all of the given fields for @scaffold_object suitable for inclusion in a form tag
def scaffold_model_field_tags(fields)
        klass = @scaffold_class
        object = @scaffold_object
        record_name = @scaffold_options[:singular_name]
        field_wrapper = klass.scaffold_field_wrapper || scaffold_default_field_wrapper
        rows = fields.collect do |field|
          field_id = klass.scaffold_field_id(field)
          label = scaffold_label("#{record_name}_#{field_id}", klass.scaffold_column_name(field))
          options = klass.scaffold_column_options(field).merge(:name=>"#{record_name}[#{field_id}]", :id=>"#{record_name}_#{field_id}")
          field_tag = scaffold_field_tag(klass.scaffold_column_type(field), options, object, field, record_name, field_id)
          field_wrapper.call(label, field_tag)
        end
        (klass.scaffold_form_wrapper || scaffold_default_form_wrapper).call(rows)
      end
def scaffold_model_field_tags ( fields ) klass = @scaffold_class object = @scaffold_object record_name = @scaffold_options [ :singular_name ] field_wrapper = klass . scaffold_field_wrapper || scaffold_default_field_wrapper rows = fields . collect do | field | field_id = klass . scaffold_field_id ( field ) label = scaffold_label ( "#{record_name}_#{field_id}" , klass . scaffold_column_name ( field ) ) options = klass . scaffold_column_options ( field ) . merge ( :name => "#{record_name}[#{field_id}]" , :id => "#{record_name}_#{field_id}" ) field_tag = scaffold_field_tag ( klass . scaffold_column_type ( field ) , options , object , field , record_name , field_id ) field_wrapper . call ( label , field_tag ) end ( klass . scaffold_form_wrapper || scaffold_default_form_wrapper ) . call ( rows ) end
An html fragment with all of the given fields for @scaffold_object, suitable for
inclusion in a form tag
An html fragment with all of the given fields for @scaffold_object suitable for inclusion in a form tag
fields