Alfred Montalvo Jr

Joined

2,030 Experience
12 Lessons Completed
1 Question Solved

Activity

Thank you very much for making this video! Your video resolved all of the issues that I was running into when I was trying install Jumpstart from the GitLab repo

I found the solution to the problem I was running into for the Flash alert/notification messages not displaying with the correct styling for the 'Log In' and 'Log Out' views. The issue was resolved after I added the alert helper rb file described in the link below.

[https://stackoverflow.com/questions/36747109/to-handle-flash-messages-types-dynamically]

The flash alert/notification for the 'Log In' and 'Log Out' views are not displayed on the screen when a user logs in or out of the Rails application.

I am not getting any errrors or warnings in my log file that I can share.

I can confirm that the Bootstrap CSS file contains the styling used for the flash alert messages.

I am using the Ruby, Rails and gem versions below:
Ruby 2.6.5
Rails 5.2.4.2
Bootstrap 4.4.1
Simple-form 5.0.2
Devise 4.7.1

After installing Simple-form I ran code below from the command line:

 rails generate simple_form:install –bootstrap

And after installing Devise I ran the code below from the command line:

  rails generate devise:install
  rails generate devise User
  rails generate devise:views

I have also added the code below to my application.html.erb:

<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>

And using the above code a flash alert/notification is only displayed for errors that are encountered on the ‘Sign up’ form.

I tried searching for a solution on the internet and I found a partial solution below that will display the flash message without the correct CSS styling for the 'Log In' and 'Log Out' views . The code below was added to my application.html.erb:

<% flash.each do |name, msg| %> 
    <div class='container-fluid' style='padding-right: 35px; padding-left: 35px'>
    <br/>
            <%= content_tag :div, msg, :id => "flash_#{name}",  :class => "alert alert-#{name}" %> 
     </div>
<% end %> 

Can anyone help me resolve the problem that I am running into with the Flash alert/notification messages not displaying with the correct styling for the 'Log In' and 'Log Out' views?

Hi Chris,
thank you very much for providing the solution to the routing error I was running into.

I am running into a routing error for a get action when I try to render an html erb view from the '../views/pages' folder via a navbar link.

I have reviewed the routes.rb file and the output from "rake routes" to verify that route for the 'about' view has been defined in the routes file.

So I do not understand why the routing error is happening when the path is defined in the route file correctly.

I have listed below the url helper that I am using in the navbar, my routes.rb file and the output from rake routes.

Does anyone have any suggestions to resolve the routing error that I am encountering?

url helper defined in _nav.html.erb:

<li class="nav-item">
  <a class="nav-link" href="pages_about_path">About</a>
</li>

routes.rb:

Rails.application.routes.draw do
  root to: 'pages#index'  
  get 'pages/about', to: 'pages#about'  
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

rake routes output:

Prefix Verb URI Pattern Controller#Action
root GET / pages#index

pages_about GET /pages/about(.:format) pages#about

Posted in Subscriptions with Stripe Discussion

Hello,
Would it be possible to add a record to the CHARGE DB for the initial subscription via the subscriptions controller?

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.