How to build a blog with Rails 5 and Bootstrap 4 – Part 1


[ad_1]
https://i.ytimg.com/vi/VpNBCpAgEsY/hqdefault.jpg



Check out https://www.techmaker.tv for tons of more content like this.

HEADS UP: In your Gemfile, you will need to change:

gem ‘bootstrap’

to:

gem ‘bootstrap’, ‘4.0.0.alpha3’

Download the code from the Github repo:

https://github.com/StephenFiser/FrogBlog

In this episode, we go over setting up a basic project with Ruby on Rails 5 and Bootstrap 4. We talk about how to build nice looking URLs for your blog posts using the FriendlyId gem.

We also go over how to pass variables between the layout and the view using yield and provide.

Finally, we discuss instance variables and ERB tags.

Original source


17 responses to “How to build a blog with Rails 5 and Bootstrap 4 – Part 1”

  1. Hi! I followed the same instruction for the same link. Its not Bootstrap 4.1.1 and for some reason its not working.
    I am getting "invalid regexp character" at "stylesheed_link_tag" line in application.html.erb file
    Help

  2. I have been following your tutorial, but i have some issues with rail versions, since mine is 5.1, you see, the navbar dosent work, it gives me some kind of a crazy look, secondely it sayss that the popper library is not present when it is

  3. I have a problem with migration and solution 🙂

    Rails version: 5.1.0.rc1
    Ruby version: 2.4.0 (x86_64-linux)

    StandardError: An error has occurred, this and all later migrations canceled:
    Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: class RolifyCreateRoles < ActiveRecord::Migration[4.2]

    Solution: I change class RolifyCreateRoles < ActiveRecord::Migration to class RolifyCreateRoles < ActiveRecord::Migration[5.0]

  4. Hey,
    Sorry for bringing this up late but I had to mention something.
    I used
    gem 'bootstrap', '4.0.0.alpha6' and my navbar was arranged vertically not horizontally ie
    FrogBlog
    About
    Contact
    instead of FrogBlog About Contact
    So just incase someone starting the series sees this if possible don't use that version, use the one Stephen recommends, I've just used it on a different project and I'm getting the same issue. I don't know what the problem is.

  5. Small tip, when someone is trying to follow along on youtube, if you make everything your typing be right at the bottom on the page, you are placing it under the video interface meaning that if you go too fast and someone tries to pause to see what you typed… they can't.

  6. Hi,

    Thanks for you great tutorials. They help me so much in learning ruby on rails 5.
    Please make more tutorials till this FrogBlog to finish to the limit you could make. And I sure you can do that ….

    I wish you are well…

    Nyoman, Bali, Indonesia

Leave a Reply