Sha256: fe2dc70c8e3d6abcc17ae7920b77db4458650f7abb61b2966e309e217d7c0914

Contents?: true

Size: 915 Bytes

Versions: 5

Compression:

Stored size: 915 Bytes

Contents

module PublishMyData
  module ApplicationHelper

    def bodyclass(c)
      @bodyclass = c;
    end

    def set_page_title(title=nil)
      content_for :page_title do
        "| #{title}"
      end
    end

    def appname
      PublishMyData.application_name
    end

    def page_description(description)
      content_for :page_description do
        # should be content_tag(:meta, '', name: 'description', content:description)
        # but content tag doesn't generate valid html accoring to the w3c validator :(
        # content_tag(:meta, '', name: 'description', content: "hello world") => <meta content="hello world" name="description"></meta>
        if (description)
          raw "<meta name='description' content='#{description}'>"
        end
      end
    end

    def pagination_required?(resources, pagination_params)
      (resources.total_count > pagination_params.per_page)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
publish_my_data-1.2.4 app/helpers/publish_my_data/application_helper.rb
publish_my_data-1.2.3 app/helpers/publish_my_data/application_helper.rb
publish_my_data-1.2.2 app/helpers/publish_my_data/application_helper.rb
publish_my_data-1.2.1 app/helpers/publish_my_data/application_helper.rb
publish_my_data-1.2.0 app/helpers/publish_my_data/application_helper.rb