class ArticlesController < ApplicationController

  def edit
  end

  def check_length 
    body_text = request.raw_post || request.query_string

    total_words = body_text.split(/\s+/).length
    total_chars = body_text.length
    if ( total_chars >= 255 )
      render :text => "<p class=\"error\">Uwaga: tekst jest za dugi!
                        (You have #{total_chars} characters; #{total_words}
                        words.)</p>" 
    else    
      render :nothing => true
    end
  end
end