1,230 Experience
0 Lessons Completed
1 Question Solved


When I set this up everything works but when I go to another page then hit the back button to go back to the form with flatpickr on it it duplicates the date field and continues to do so each time you transition out then back.

I also cloned this projects repo and it also does it with it. Any thoughts on why it is doing this?

Thanks for the info! I was going by this video where he said the "active" variants were turned off by default to save space. I can create custom classes though.

Do you have to enable the active classes in Tailwind or are they there by default now? I didn't see a tailwind.js file only the postcss config. Is that where you would declare variants for tailwind?

Ahhh yes that worked. Thanks!

From what I understand the "active variant" is not enabled by default? Where exactly do you enable that with rails? Is there another way to add and remove parts of classes to put together an active link depending on where you are in a rails site?

Any info is appreciated!

I have an issue I haven't been able to solve. I have a products page set up with some different sections via bootstrap 4 nav tabs. General Info, Images, Pricing etc. I am trying to make it so that if I upload new product images and it reloads the screen it stays on the images nav tab by setting that tab active. I have been struggling to get that working though. Here is my page:

<%= form_with(model: admin_product, local: true) do |form| %>
 <div class="nav-tabs-top nav-responsive-sm">
   <ul class="nav nav-tabs">
     <li class="nav-item">
       <a class="nav-link active" data-toggle="tab" href="#item-info" >Product Info</a>
     <li class="nav-item">
       <a class="nav-link" data-toggle="tab" href="#item-pricing" >Product Pricing</a>
     <li class="nav-item">
       <a class="nav-link" data-toggle="tab" href="#item-images" >Product Images</a>

   <div class="tab-content">

   <div class="tab-pane fade show active" id="item-info">

   <div class="tab-pane fade" id="item-pricing">

   <div class="tab-pane fade" id="item-images">

<% end %> 

Any ideas on how I can set this up?

Question on this. Say I have a join to another via an integer ID. I want to display in a bucket the description of the ID vale from the other table. How do you do that?

Project joins to project_statuses with proj_status_id. I can return the proj_status_ids in the bucket but what I really want is to display the statusdescr field I get from the secondary table.

How would I do this?

Posted in Improving In-App Notifications Discussion

I think I see what the issue is. It seemed to work fine then stop, work fine then stop etc. What is going on is that to clean up I was deleting comments on the screen. Since that was orphaning the notifications unable to find the comment and then unable to find the project that was causing the 500 error.

Now I am just trying to figure out the best way to destroy any notifications when the comments are deleted.

Posted in Improving In-App Notifications Discussion

This was great. I am mostly there but having a strange issue. Instead of forum posts and forum threads I am using comments and projects. When I am trying to pull the notifications and display the count I see a 500 errror in the console:

ActionView::Template::Error (undefined method project' for nil:NilClass):
1: <%= link_to project_path(notification.notifiable.project, anchor: dom_id(notification.notifiable)), class: "dropdown-item #{"unread" if !notification.read_at?}" do %>
2:   <%= %>
3:   <%= notification.action %>
4:   a <%= notification.notifiable_type.underscore.humanize.downcase %>

Any thoughts on what the issue could be?

I want to get some action cable notifications working on my site. I have never used redis before or action cable. I see there are videos on gorails on action cable that seem to spec that you have redis configured. I'm not sure where to start with all this.

I have my site running within my organization on an ubuntu 18.04 server. Can I run redis on that same server or do I need a separate server for that? I won't have tons of traffic. This is an internal tool we are using with my group.

Any info or suggestions is appreciated.

Posted in How to use Action Mailbox in Rails 6 Discussion

I second the request for a full gmail action mailbox example.

Posted in How to use Action Mailbox in Rails 6 Discussion

Interesting. Thanks!

Posted in How to use Action Mailbox in Rails 6 Discussion

This is great!

Can action mailbox be used with a gmail account or does it have to be one of the services listed?

Posted in Stimulus JS Twitter UI: Part 1 Discussion

I am having an issue deploying a site with stimulus via capistrano. I get the error:

ModuleNotFoundError: Module not found: Error: Can't resolve './controllers' in '/home/deploy/site/releases/20190501124321/app/javascript/packs'

My directory is:

App/javascript/packs/controllers. Inside packs I have application.js which references ./controllers.

Any ideas why this is failing?

UPDATE: I figured it out. My controllers folder didn't have anything in it yet and was not syncing.

Posted in Stimulus JS Twitter UI: Part 2 Discussion

Very cool. Thank you!

Posted in Stimulus JS Twitter UI: Part 2 Discussion

I sort of do this with a comment system I built with this. I just give the divs different ID's like this:

<div class="feed-element" id="<%= dom_id(comment) %>">

I loop through all comments related to a project and any of them can be inline edited. I would think it should be similar to different fields maybe?

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

I figured it out! In my LDAP.yml file the production connection section was indented by one space. This was causing it to not load the config correctly. Everything is working now. This was a great guide.

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

Went through this whole guide with an on premise linux server my IT provided for me. The site is up and running but I am having an issue when trying to log in via devise. It runs fine in development but when I try to log in on the production server I see the following happen:

I, [2019-03-14T12:51:12.088584 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0] Started GET "/users/sign_in" for at 2019-03-14 12:51:12 -0400
I, [2019-03-14T12:51:12.091644 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0] Processing by Devise::SessionsController#new as HTML
I, [2019-03-14T12:51:12.153396 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0]   Rendering devise/sessions/new.html.erb within layouts/application
I, [2019-03-14T12:51:12.161526 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0]   Rendered devise/sessions/new.html.erb within layouts/application (8.0ms)
I, [2019-03-14T12:51:12.164358 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0]   Rendered layouts/partials/_sidebar.html.erb (0.6ms)
I, [2019-03-14T12:51:12.165813 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0]   Rendered layouts/partials/_navigation.html.erb (0.9ms)
I, [2019-03-14T12:51:12.166734 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0]   Rendered layouts/partials/_footer.html.erb (0.4ms)
I, [2019-03-14T12:51:12.167103 #10760]  INFO -- : [21ce2d59-057f-4754-a31b-93d4c50c47b0] Completed 200 OK in 75ms (Views: 16.9ms | ActiveRecord: 12.8ms)
I, [2019-03-14T12:51:16.963715 #10760]  INFO -- : [49205864-1120-4ba2-966a-be10eccde503] Started POST "/users/sign_in" for at 2019-03-14 12:51:16 -0400
I, [2019-03-14T12:51:16.964576 #10760]  INFO -- : [49205864-1120-4ba2-966a-be10eccde503] Processing by Devise::SessionsController#create as HTML
I, [2019-03-14T12:51:16.964650 #10760]  INFO -- : [49205864-1120-4ba2-966a-be10eccde503]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"B1XM0xLT2kvQ9Kk2AavOtYGehSt5yMU/UnmjMRo45kgfRD5EWoW9aUO7t3CmR3q2LNplzwgdlYQv76g6u/67hA==", "user"=>{"username"=>"UserX", "password"=>"[FILTERED]"}, "commit"=>"Log in"}
D, [2019-03-14T12:51:16.969778 #10760] DEBUG -- : [49205864-1120-4ba2-966a-be10eccde503]   User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."username" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["username", "UserX"], ["LIMIT", 1]]
I, [2019-03-14T12:51:16.972481 #10760]  INFO -- : [49205864-1120-4ba2-966a-be10eccde503] Completed 500 Internal Server Error in 8ms (ActiveRecord: 1.2ms)

I am wondering why it is giving a 500 error when querying the users table? For my DB config I am specifying deploy and password for the connection. I can use PSQL, log into the production DB and query the table so I know the username and password are good.

Any thoughts on what this means?

Posted in How to use Google Maps and Markers Discussion

Chris in regards to the show page mentioned above what would the syntax look like to just display the one item on the show page? Not too familiar with arrays to know how to set that up.

I figured it out. Somehow must have removed the reference to include the application.js file in my application.html.erb. Adding that back in has resolved the issue!

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.