ruby-on-rails-6

I can't get Trix Editor to show properly in Bootstrap theme

泪湿孤枕 提交于 2020-05-17 07:15:06
问题 I am trying to setup ActionText for the first time on my Article model. This is how my Article model looks: class Article < ApplicationRecord has_rich_text :body end I set up ActionText like so: rails action_text:install My app/javascript/packs/application.js looks like this: // This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and

Postfix Setup for Action Mailbox

天大地大妈咪最大 提交于 2020-05-15 10:48:21
问题 I followed the instructions from the offical Ruby on Rails Guide. I can run a script on incoming mail. But I have no clue how to invoke the action_mailbox:ingress:postfix command. Somehow I have to switch into the workspace and then run bin/rails. Is there some best practice for sending the mail to rails? 回答1: You can follow the steps to configure postfix with action mailbox in production server: Step 1: Create bash script Create a script inside /usr/local/bin/ to forward all incoming emails

$(…).tooltip is not a function rails 6 webpack

狂风中的少年 提交于 2020-05-12 07:55:27
问题 I have tried changing the versions of bootstrap, jquery, and popper but no luck. I don't think I am using more than one version of jquery. Not sure where it went wrong. It would be great if someone helps me to find what I am missing. Here is my list of files, package.json: { "name": "kf", "private": true, "dependencies": { "@fortawesome/fontawesome-free": "^5.12.1", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.2.2", "bootstrap": "^4.4.1", "jquery": "^3.4.1", "popper.js": "^1.16.1",

while population sub category dropdown receive below error active admin

只愿长相守 提交于 2020-04-30 08:46:47
问题 Error:- ActionView::MissingTemplate (Missing template admin/blogs/get_child_category, active_admin/resource/get_child_category, active_admin/base/get_child_category, inherited_resources/base/get_child_category, application/get_child_category with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json,

while population sub category dropdown receive below error active admin

匆匆过客 提交于 2020-04-30 08:46:22
问题 Error:- ActionView::MissingTemplate (Missing template admin/blogs/get_child_category, active_admin/resource/get_child_category, active_admin/base/get_child_category, inherited_resources/base/get_child_category, application/get_child_category with {:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json,

Alternative for Model.all - Model.where(condition)

我们两清 提交于 2020-04-30 07:09:04
问题 My question is quiet simple: How to optimize the following query to not get performance issues once the database is growing: def projects_not_participating @project = Project.all - Project.joins(:participants).where(participant: {id: current_user.id}) end My model setup is this: def Project has_many :assignments has_many :participants, through: :assignments end def Participant has_many :assignments has_many :projects, through: assignments end I tried using Project.joins(:participant).where

How to add jquery third party plugin in rails 6 webpacker

有些话、适合烂在心里 提交于 2020-04-28 08:30:33
问题 I know its simple but with update of rails 6. there is new syntax in rails 6 for manage javascript assets which is maintained by webpacker. //application.js require("@rails/ujs") //.start() require("turbolinks").start() require("@rails/activestorage").start() require('jquery').start() require('jquery_ujs').start() require('bootstrap-daterangepicker').start() require("custom/custom").start() require("bootstrap").start() require("channels") i am able to add custom/custom but bootstrap and

Rails 6 and Tailwind CSS does not deploy to Heroku

不羁岁月 提交于 2020-04-13 17:09:26
问题 I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000. I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following error I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked. I have commented out <%= stylesheet_pack_tag %> ... didn't help I have toggled extract_css: true in webpacker.yml file .... didn't help I have run

Rails 6 and Tailwind CSS does not deploy to Heroku

爱⌒轻易说出口 提交于 2020-04-13 17:09:21
问题 I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000. I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following error I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked. I have commented out <%= stylesheet_pack_tag %> ... didn't help I have toggled extract_css: true in webpacker.yml file .... didn't help I have run

Webpacker can't find application

强颜欢笑 提交于 2020-04-13 07:15:42
问题 I'm creating a new rails application according to "Getting Started with Rails". The application starts normally in step 4.1. But when i create my first controller, i have a webpack error. I'm new in webpack, i have red all documentation, but i don't understand what is wrong or missing... Windows 10 1903 ruby 2.6 rails 6.0.0 nodeJS 12.11.0 rails webpacker:install identical config/webpacker.yml Copying webpack core config exist config/webpack identical config/webpack/development.js identical