lib/ahc_helper.rb in ahc-0.3.1 vs lib/ahc_helper.rb in ahc-0.3.2

- old
+ new

@@ -2,9 +2,13 @@ require 'uri' module AhcHelper def render_ahc(template) + if defined? Rails && @data + @data ||= {} + @data['authenticity_token'] = form_authenticity_token + end if params[:format] == 'json' render json: @data else render text: Ahc.render(template, @data) end