lib/scaffolding_extensions/helper.rb
# Returns an appropriate scaffolded data entry form for the model, with any related error messages.
# If a block is given, it yields an empty string which should be modified with html to be added 
# inside the form before the submit button.
Returns an appropriate scaffolded data entry form for the model, with any related error messages.
If a block is given, it yields an empty string which should be modified with html to be added
inside the form before the submit button.
Returns an appropriate scaffolded data entry form for the model with any related error messages . If a block is given it yields an empty string which should be modified with html to be added inside the form before the submit button .
def scaffold_model_form(action, fields, &block)
        content = ''
        options = {}
        options[:id] = @scaffold_object.scaffold_id if action=='update'
        <<-END
        #{scaffold_model_error_messages}
        #{scaffold_form(scaffold_url("#{action}#{@scaffold_suffix}", options), :attributes=>scaffold_form_enctype(fields))}
        #{scaffold_model_field_tags(fields)}
        #{(yield content; content) if block_given?}
        <input class='btn btn-primary' type='submit' value="#{@scaffold_submit_value || "#{action.capitalize} #{@scaffold_options[:singular_human_name]}"}" />
        </form>
        END
      end
def scaffold_model_form ( action , fields , & block ) content = '' options = { } options [ :id ] = @scaffold_object . scaffold_id if action == 'update' <<-END #{ scaffold_model_error_messages } #{ scaffold_form ( scaffold_url ( "#{action}#{@scaffold_suffix}" , options ) , :attributes => scaffold_form_enctype ( fields ) ) } #{ scaffold_model_field_tags ( fields ) } #{ ( yield content ; content ) if block_given? } 
        <input class='btn btn-primary' type='submit' value=" #{ @scaffold_submit_value || "#{action.capitalize} #{@scaffold_options[:singular_human_name]}" } " />
        </form>
         END end
Returns an appropriate scaffolded data entry form for the model, with any related error messages.
Returns an appropriate scaffolded data entry form for the model with any related error messages .
action
fields
block