GithubHelp home page GithubHelp logo

mongoid / mongoid-tag-collectible Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 1.0 36 KB

Easily maintain a collection of Tag instances with aggregate counts from your model's tags.

License: MIT License

Ruby 100.00%

mongoid-tag-collectible's Introduction

Mongoid

This is the legacy fork which is no longer maintained. The official repository is now under the MongoDB organization here.

mongoid-tag-collectible's People

Contributors

dblock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dblock

mongoid-tag-collectible's Issues

Question on tags

Can you please help me to understand your gem.

1. Do tags have to be in the model as a field?
2. How do I query the tags in the controller?
3. What about showing the tags in the view, how do I call them?

Here is what I have in my model so far…

  class Blog::Post
      include Mongoid::Document
      include Mongoid::TagCollectible::Tagged

      before_validation :downcase_tags

      validates_presence_of :body, :title, :summary

      mount_uploader :post_pic, PostPicUploader
       field :title, type: String
       field :body, type: String
       field :tags, type: String
       field :date, type: DateTime
       field :summary, type: String
       field :post_type, type: String
       field :author, type: String

        private

      def downcase_tags
        tags.map(&:downcase) if tags
     end

  end

I'm unsure if my model is correct and don't see what to put in my controlle. Any help would be greatly appreciated. BTW I am using Mongoid 5.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.