Sha256: c29be39f21349fedd7c42033ee24eb559d4ba5a51b11ae03dba18e7cb239b11d

Contents?: true

Size: 527 Bytes

Versions: 3

Compression:

Stored size: 527 Bytes

Contents

Application.class_eval do
  helpers do
    
    def errors_on(attribute)
      @user && @user.errors.on(attribute)
    end
    
    def field(type, attribute, question)
      partial(
        :field,
        :locals => {
          :attribute => attribute,
          :checkbox => type == :checkbox,
          :question => question
        }
      )
    end
    
    def valid?(attribute=nil)
      if attribute
        @user && @user.errors.on(attribute).nil?
      else
        @user && @user.valid?
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
winton-sum-0.1.1 lib/sum/helper/new.rb
sum-0.1.2 lib/sum/helper/new.rb
sum-0.1.1 lib/sum/helper/new.rb