kpumuk / meta-tags

Search Engine Optimization (SEO) for Ruby on Rails applications.
MIT License
2.73k stars 275 forks source link

I have another gem initializing the variable @page_description #174

Closed thebravoman closed 5 years ago

thebravoman commented 6 years ago

I am using another gem an it initializes the variable @page_description with some model. It is not a string. It's a model.

meta-tags is not working because of

# Normalize description value.
    #
    # @param [String] description description string.
    # @return [String] text with tags removed, squashed spaces, truncated
    # to 200 characters.
    #
    def normalize_description(description)
      return '' if description.blank?
      description = cleanup_string(description)
      truncate(description, MetaTags.config.description_limit)
    end

where the method strip of the description is called.

My suggestion is to have an option to disable meta-tags to take values from controller or to call

description.to_s before processing the description. 
thebravoman commented 6 years ago

Created a PR https://github.com/kpumuk/meta-tags/pull/175