Sha256: 5b136ef3b91d1acf8481f79c49b4b828410605fb0ec09c4b7ca7d658a102645b

Contents?: true

Size: 352 Bytes

Versions: 10

Compression:

Stored size: 352 Bytes

Contents

module Georgia
  module StatesHelper

    def state_label_tag state
      content_tag(:span, state.try(:humanize), class: "label label-#{css_class(state)}")
    end

    def css_class state, options={}
      case state
      when 'draft' then 'warning'
      when 'pending' then 'info'
      when 'published' then 'success'
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
georgia-0.8.0 app/helpers/georgia/states_helper.rb
georgia-0.7.8 app/helpers/georgia/states_helper.rb
georgia-0.7.7 app/helpers/georgia/states_helper.rb
georgia-0.7.6 app/helpers/georgia/states_helper.rb
georgia-0.7.5 app/helpers/georgia/states_helper.rb
georgia-0.7.4 app/helpers/georgia/states_helper.rb
georgia-0.7.3 app/helpers/georgia/states_helper.rb
georgia-0.7.2 app/helpers/georgia/states_helper.rb
georgia-0.7.1 app/helpers/georgia/states_helper.rb
georgia-0.7.0 app/helpers/georgia/states_helper.rb