Images not rendering in Rails App - ruby-on-rails

i'm total beginner with all programming stuff. I decided to create a website (or should I say application? ;p) using bootstrap. Since i found Ruby very attractive i decided to integrate these 2 frameworks. So i did following this: https://github.com/twbs/bootstrap-rubygem
It went fine, i downloaded some bootstrap theme, throw all the files to my app files, change img paths in index.html.erb and when i started the server i got a website without any image. What am i doing wrong? I would appriciate any help.
my index.html.erb (which i copied from template folder)
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Creative - Start Bootstrap Theme</title>
<!-- Bootstrap core CSS -->
<link href="test1/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="test1/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- Plugin CSS -->
<link href="test1/vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="test1/assets/stylesheets/creative.min.css" rel="stylesheet">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">Start Bootstrap</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#portfolio">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead text-center text-white d-flex">
<div class="container my-auto">
<div class="row">
<div class="col-lg-10 mx-auto">
<h1 class="text-uppercase">
<strong>Your Favorite Source of Free Bootstrap Themes</strong>
</h1>
<hr>
</div>
<div class="col-lg-8 mx-auto">
<p class="text-faded mb-5">Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>
<a class="btn btn-primary btn-xl js-scroll-trigger" href="#about">Find Out More</a>
</div>
</div>
</div>
</header>
<section class="bg-primary" id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading text-white">We've got what you need!</h2>
<hr class="light my-4">
<p class="text-faded mb-4">Start Bootstrap has everything you need to get your new website up and running in no time! All of the templates and themes on Start Bootstrap are open source, free to download, and easy to use. No strings attached!</p>
<a class="btn btn-light btn-xl js-scroll-trigger" href="#services">Get Started!</a>
</div>
</div>
</div>
</section>
<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">At Your Service</h2>
<hr class="my-4">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-diamond text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Sturdy Templates</h3>
<p class="text-muted mb-0">Our templates are updated regularly so they don't break.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-paper-plane text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Ready to Ship</h3>
<p class="text-muted mb-0">You can use this theme as is, or you can make changes!</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-newspaper-o text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Up to Date</h3>
<p class="text-muted mb-0">We update dependencies to keep things fresh.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box mt-5 mx-auto">
<i class="fa fa-4x fa-heart text-primary mb-3 sr-icons"></i>
<h3 class="mb-3">Made with Love</h3>
<p class="text-muted mb-0">You have to make your websites with love these days!</p>
</div>
</div>
</div>
</div>
</section>
<section class="p-0" id="portfolio">
<div class="container-fluid p-0">
<div class="row no-gutters popup-gallery">
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/imgages/portfolio/fullsize/1.jpg">
<img class="img-fluid" src="test1/app/assets/imgages/portfoliothumbnails/1.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/images/portfolio/fullsize/2.jpg">
<img class="img-fluid" src="test1/app/assets/images/portfoliothumbnails/2.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/images/portfolio/fullsize/3.jpg">
<img class="img-fluid" src="test1/app/assets/images/portfolio/thumbnails/3.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/app/assets/imgages/portfolio/fullsize/4.jpg">
<img class="img-fluid" src="test1/app/assets/imgages/portfolio/thumbnails/4.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/assets/images/portfoliofullsize/5.jpg">
<img class="img-fluid" src="test1/assets/images/portfoliothumbnails/5.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box" href="test1/assets/images/portfolio/fullsize/6.jpg">
<img class="img-fluid" src="test1/assets/images/portfolio/thumbnails/6.jpg" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category
</div>
<div class="project-name">
Project Name
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
<section class="bg-dark text-white">
<div class="container text-center">
<h2 class="mb-4">Free Download at Start Bootstrap!</h2>
<a class="btn btn-light btn-xl sr-button" href="http://startbootstrap.com/template-overviews/creative/">Download Now!</a>
</div>
</section>
<section id="contact">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto text-center">
<h2 class="section-heading">Let's Get In Touch!</h2>
<hr class="my-4">
<p class="mb-5">Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center">
<i class="fa fa-phone fa-3x mb-3 sr-contact"></i>
<p>123-456-6789</p>
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fa fa-envelope-o fa-3x mb-3 sr-contact"></i>
<p>
feedback#startbootstrap.com
</p>
</div>
</div>
</div>
</section>
<!-- Bootstrap core JavaScript -->
<script src="test1/vendor/jquery/jquery.min.js"></script>
<script src="test1/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="test1/vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="test1/vendor/scrollreveal/scrollreveal.min.js"></script>
<script src="test1/vendor/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Custom scripts for this template -->
<script src="test1/app/assets/javascript/creative.min.js"></script>

Use the helper classes:
<img class="img-fluid" src="test1/app/assets/images/portfolio/thumbnails/3.jpg" alt="">
becomes
image_tag("portfolio/thumbnails/3.jpg", class: "img-fluid")
Which should set the path correctly, assuming the file /app/assets/images/portfolio/thumbnails/3.jpg exists.

Related

BLog Pagination for dynamic data

I have to implement pagination for a dynamically binded data for blogs on a page. On the click of the next button the next blog should come and so on.
Below is the code. It is done in asp.net mvc.
</div>
<div class="absolute cust-movetext">
<!-- <small class="text-xs font-semibold text-white">Pet Care</small> -->
#*<h1 class="text-6xl font-semibold text-white">Your Dog’s Best Life In Every Bite.fe In Every Bife In Every Bi</h1>*#
<h1 class="lg:text-4xl md:text-xl text-xl font-semibold text-white mb-2 ">#Model.BlogTitle.ToString()</h1>
<p class="text-sm font-semibold text-white ml-6px"> #Model.BloggerName</p>
</div>
</div>
</section>
<div id="wrapper">
<section>
<div id="pet_offline">
<div class="container mx-auto">
<div class="lg:pt-16 md:pt-8 pt-8 lg:px-12 md:px-12 px-4">
<div class="custp font-weightlow">
<p type="hidden" class="text-3d3d3d font-normal opac-84 lh-33px custp">
#Html.Hidden("BlogId")
#*#Html.Hidden(Model.BlogId)*#
#Html.Raw(Server.HtmlDecode(Model.BlogContent))
</p>
</div>
</div>
</div>
</div>
<div >
<button id="prebtn" class="btn">PREVIOUS</button>
<button id="nexbtn" class="btn" align="right">NEXT</button>
<img src="../content/images/bg-city.png" alt="city" class="w-full" />
</div>
</section>
</div>
Here is the code that has the data binded and I need to add pagination on this. How to do that?

The next section is below previous section

I make card wrap by container
here is my code
i make new section next to this section.. but next section is below this section..
what makes next section is below previous section, btw i am using bootstrap 5
<div class="container-fluid room">
<h2 class="room-section-title text-center"> Our Rooms</h2>
<div class="container d-flex justify-content-evenly align-items-center flex-md-column flex-lg-row flex-column ">
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Superior Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Deluxe Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Suite Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
</div>
</div>
You have to provide the whole file. Then only we can answer it.

Put a link on the right of a card - bootstap

I have a page (show route) that looks like this:
and i would like to position the link to "All Camgrounds" to the right of the card. I tried several things like adding classes like "text-right" or "justify-content-end", but it did not work.
I am using the framework Boostrap-5.
Any help would be much appreciated. Here is the code for the SHOW page :
<% layout('layouts/boilerplate') %>
<div class="row">
<div class="col-6 offset-3">
<div class="card">
<div class="card-header">
<h2>
<%= campground.title %>
</h2>
</div>
<img src="<%= campground.image %>" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">
<%= campground.description %>
</p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item text-muted">
<%= campground.location %>
</li>
<li class="list-group-item">
$ <%= campground.price %> /night
</li>
</ul>
<div class="card-body">
<a class="card-link btn btn-warning" href="/campgrounds/<%= campground._id %>/edit">Edit</a>
<form class="d-inline" action="/campgrounds/<%= campground._id %>?_method=DELETE" method="post">
<button class="btn btn-danger">Delete</button>
</form>
<a class="card-link d-inline text-right" href="/campgrounds">All
campgrounds</a>
</div>
</div>
</div>
</div>
There are many different ways to align right in Bootstrap 5.
In your case it's probably easiest to use float-end.
<div class="row">
<div class="col-6 offset-3">
<div class="card">
<div class="card-header">
<h2> Title </h2>
</div>
<img src="//via.placeholder.com/500" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text"> campground.description </p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item text-muted"> campground.location </li>
<li class="list-group-item"> $ 39/night </li>
</ul>
<div class="card-body">
<a class="card-link btn btn-warning" href="/campgrounds/<%= campground._id %>/edit">Edit</a>
<form class="d-inline" action="/campgrounds/<%= campground._id %>?_method=DELETE" method="post">
<button class="btn btn-danger">Delete</button>
</form>
<a class="card-link float-end" href="/campgrounds">All campgrounds</a>
</div>
</div>
</div>
</div>
https://codeply.com/p/S9PyKHZC9y
Also note, left and right have been replaced with start and end in Bootstrap 5.

Apply styling for iphone

I am having a issue with the styling for the iphone.
I have this form where it displays list of doctors base on a list of doctors from the db and it it generates the results correctly.
However, when the results are generated, you need to swipe from right to left to see the info.
How can I target only Iphone users so the information is within the frame of the iphone?
Here is the following form I used. Ignore the "##", I am using coldfusion and bootstrap.
$(function(){
$('##myModal').modal('show');
});
<div class="widthResults">
<nav class="hidden-xs visible-md visible-lg" ng-show="ShowResults"><uib-pagination boundary-links="true" max-size="maxPageNumbersToShow" ng-model="currentPage" total-items="resultsCount"> </uib-pagination></nav>
<nav class="visible-xs hidden-md hidden-lg" ng-show="ShowResults"><uib-pager ng-model="currentPage" total-items="resultsCount"> </uib-pager></nav>
<div class="container">
<div id="searchResults" ng-repeat="e in providers" ng-show="ShowResults">
<div class="row">
<hr />
<h4>{{e.FullName}}</h4>
</div>
<div class="row">
<div class="col-md-4 no-margin padding"><strong>Specialty: </strong>{{e.Specialty}}<br />
<span class="padding"><strong>Gender:</strong> {{e.Gender}}</span><br />
<strong>Language(s):</strong> {{e.Languages}}</div>
<div class="col-md-4 no-margin"><strong>Clinic: </strong> <i class="glyphicon glyphicon-map-marker"></i> {{e.Address1}}<br />
<span class="shiftAdd padding">{{e.Address2}} </span><br />
<strong>Phone:</strong> <i class="glyphicon glyphicon-earphone"></i> {{e.Phone | PhoneNumber}}</div>
</div>
</div>
</div>
<nav class="visible-xs hidden-md hidden-lg" ng-show="ShowResults">
<hr /><uib-pager ng-model="currentPage" total-items="resultsCount"> </uib-pager></nav>
</div>

i need help getting ratchet push.js fade transition to work?

this is a basic example calling "two.html", with the fade transition
<div class="content">
<div class="medium-6 columns text-center top">
POSPAId
</div>
</div>
and this is two.html
<div class="content">
<div class="medium-6 columns text-center top">
<a href="index.html" data-transition="slide-out">
back
</a>
</div>
</div>

Resources