Added flash message

This commit is contained in:
Israel Ogbole 2016-06-17 16:15:44 +01:00
parent b7b07c0daa
commit e08b8ee5f2
10 changed files with 46 additions and 94 deletions

View File

@ -13,23 +13,32 @@ Setup:
4. bower install
5. bundle install
6. rake rails:update:bin
7. rails s
That's it!
Navigate to http://localhost:3000/plainpage/index
Navigate to http://localhost:3000
![gentelella on rails ](https://cloud.githubusercontent.com/assets/2548160/14771111/a1523f80-0a78-11e6-87bb-9de1156faf51.png)
![gentelella on rails ](https://cloud.githubusercontent.com/assets/2548160/16155032/63da00fa-34a5-11e6-917e-f7a616d7bd50.png)
------------------------------------------------------------------------
If you're using devise, you'd need to create another layout to handle authentication and sign_ups as discussed in [issue #2](https://github.com/iogbole/gentelella_on_rails/issues/2).
If you're using devise, you'd need to create another layout to handle authentication and sign_ups as discussed in [issue #2](https://github.com/iogbole/gentelella_on_rails/issues/2).
This is the [login template](https://gist.github.com/iogbole/a2f1ddf330cb5194967a1996369619e8). And this is what it looks like:
This is the [login template](https://gist.github.com/iogbole/a2f1ddf330cb5194967a1996369619e8). And this is how it looks:
![enter image description here](https://cloud.githubusercontent.com/assets/2548160/14933076/fb9724d2-0e7a-11e6-8e3a-26c352576d07.png)
----------
*I committed the vendor files to this repo so you may skip step 3 and 4*
*I committed the vendor files to this repo so you may skip step 3 and 4*
**Contributing**
In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), everyone is encouraged to help improve this project. Here are a few ways you can pitch in:
- Report bugs or issues
- Fix bugs and submit pull requests.
- Write, clarify or fix documentation.
- Refactor code.

View File

@ -24,18 +24,8 @@
//= require js/flot/curvedLines.js
//= require js/flot/jquery.flot.resize.js
//= require js/maps/jquery-jvectormap-2.0.3.min.js
//= require js/maps/gdp-data.js
//= require js/maps/jquery-jvectormap-world-mill-en.js
//= require js/maps/jquery-jvectormap-us-aea-en.js
//= require js/bootstrap.min.js
//= require js/gauge/gauge.min.js
//= require js/gauge/gauge_demo.js
//= require js/progressbar/bootstrap-progressbar.min.js
//= require js/icheck/icheck.min.js
@ -45,18 +35,11 @@
//= require js/chartjs/chart.min.js
//= require js/custom.js
//= require js/pace/pace.min.js
//= require js/nprogress.js
//= require js/select/select2.full.js
//= require js/dropzone/dropzone.js
//= require js/pace/pace.min.js
//= require_tree .
//= require flash.js

View File

@ -0,0 +1,6 @@
$(function() {
$('#flash').delay(500).fadeIn('normal', function() {
$(this).delay(2500).fadeOut();
});
});

View File

@ -0,0 +1 @@
//= require js/custom.js

View File

@ -1,4 +1,10 @@
class PlainpageController < ApplicationController
def index
flash[:success ] = "Success Flash Message: Welcome to GentellelaOnRails"
#other alternatives are
# flash[:warn ] = "Israel don't quite like warnings"
#flash[:danger ] = "Naomi let the dog out!"
end
end

View File

@ -1,14 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>GentelellaOnRails</title>
<title><%= content_for?(:title) ? yield(:title) : "GentelellaOnRails" %> </title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body class="nav-md">
<div class="container body">
<% flash.each do |key, value| %>
<div align="center" id="flash" class="alert alert-<%= key %>"><%= value %></div>
<% end %>
<%= render "partials/sidenav" %>
<%= render "partials/topnav" %>
@ -16,7 +23,7 @@
<%= yield %>
<%= render "partials/footer" %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'footermanifest', 'data-turbolinks-track' => true %>
</body>
</html>

View File

@ -50,4 +50,4 @@
<!-- /page content -->
<!--Test Page specific JS -->
<script> alert ('Test JS')</script>
<script> alert ('Test Page specific JS')</script>

View File

@ -1,60 +0,0 @@
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>Form Upload </h3>
</div>
<div class="title_right">
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Go!</button>
</span>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Dropzone multiple file uploader</h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Settings 1</a>
</li>
<li><a href="#">Settings 2</a>
</li>
</ul>
</li>
<li><a class="close-link"><i class="fa fa-close"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<p>Drag multiple files to the box below for multi upload or click to select files. This is for demonstration purposes only, the files are not uploaded to any server.</p>
<form action="choices/form_upload.html" class="dropzone" style="border: 1px solid #e5e5e5; height: 300px; "></form>
<br />
<br />
<br />
<br />
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->

View File

@ -9,3 +9,5 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w( footermanifest.js)

View File

@ -1,11 +1,9 @@
Rails.application.routes.draw do
get 'plainpage/index'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
root 'plainpage#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'