Class: Clot::LiquidFormFor

Inherits:
LiquidForm
  • Object
show all
Defined in:
lib/clot/form_for.rb

Constant Summary

Constants inherited from LiquidForm

Clot::LiquidForm::Syntax

Instance Method Summary collapse

Methods inherited from LiquidForm

#get_form_footer, #initialize, #render, #render_form, #set_upload, #syntax_error

Methods included from TagHelper

#resolve_value, #split_params

Methods included from FormFilters

#concat, #drop_class_to_table_item, #form_file_item, #form_input_item, #form_item, #form_select_item, #form_text_item, #get_attribute_value, #get_error_class, #get_id_from_name, #get_selection_value, #input_to_text, #set_param, #submit_button

Methods included from LinkFilters

#delete_link, #edit_link, #gen_delete_link, #gen_delete_onclick, #index_link, #new_link, #stylesheet_link, #view_link

Methods included from UrlFilters

#delete_link, #edit_link, #get_nested_edit_url, #get_nested_url, #index_link, #object_url, #stylesheet_url, #view_link

Constructor Details

This class inherits a constructor from Clot::LiquidForm

Instance Method Details

#get_errors(model) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/clot/form_for.rb', line 74

def get_errors(model)
  errors = []
  model.errors.each do |attr,msg|
    errors << attr
  end
  errors

end

#get_form_body(context) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/clot/form_for.rb', line 84

def get_form_body(context)
  context.stack do
    context['form_model'] =  @model
    context['form_class_name'] =  @class_name
    context['form_errors'] =  get_errors @model
    return render_all(@nodelist, context)
  end
end