lib/formalizer/form.rb
# Parses the path/html into a final html template,
# Creates and fills @html_template variable for further binding.
# * +path_or_html+ - Either a path to a template html file, or a raw html
Parses the path/html into a final html template,
Creates and fills @html_template variable for further binding.
+path_or_html+ - Either a path to a template html file, or a raw html
Parses the path / html into a final html template Creates and fills @html_template variable for further binding . + path_or_html + - Either a path to a template html file or a raw html
def parse path_or_html
      @html_template = Nokogiri::HTML(path_or_html)
      return if @html_template.css('formalizer').length > 0 
      error_message = 'not a file and not valid html with <formalizer> tag/s'
      html_file_content = Utils::find_file(path_or_html)
      @html_template = Nokogiri::HTML(html_file_content)
      return if @html_template.css('formalizer').length > 0 
      raise WrongFormTemplate, error_message
    end
def parse path_or_html @html_template = Nokogiri :: HTML ( path_or_html ) return if @html_template . css ( 'formalizer' ) . length > 0 error_message = 'not a file and not valid html with <formalizer> tag/s' html_file_content = Utils :: find_file ( path_or_html ) @html_template = Nokogiri :: HTML ( html_file_content ) return if @html_template . css ( 'formalizer' ) . length > 0 raise WrongFormTemplate , error_message end
Parses the path/html into a final html template,
Creates and fills @html_template variable for further binding.
Parses the path / html into a final html template Creates and fills @html_template variable for further binding .
# trying HTML first # html indeed, parsed. # not html, trying path # file opened, parsed.
path_or_html
<not_specific>