# usefultag **Repository Path**: zhongsheng/usefultag ## Basic Information - **Project Name**: usefultag - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-16 - **Last Updated**: 2024-01-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Usefultag Let Ruby on Rails ActiveRecord has many useful tags. ## Usage How to use my plugin. ## Installation Add this line to your application's Gemfile: ```ruby gem 'usefultag' ``` And then execute: ```bash bundle rails usefultag:install:migrations rails db:migrate ``` ## AcitveController ``` ruby private def book_params ... book_tags: [] ... end ``` ## AcitveRecord Model ``` ruby has_many_useful_tags :book_tags # Mode methods book_tags_str('-') #=> tag1-tag2-tag3 book_tags_str #=> tag1,tag2,tag3 ``` ## View ``` html+erb <%= form_with(model: book, local: true) do |form| %> ...