diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/.gitignore b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/.gitignore similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/.gitignore rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/.gitignore diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile new file mode 100644 index 0000000..32124a6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile @@ -0,0 +1,50 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.7' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.1.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem 'turbolinks' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +# Use ActiveModel has_secure_password +gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' +end + +gem 'hirb' +# gem 'client_side_validations' +gem 'rails-footnotes', '~> 4.0' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile.lock b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile.lock new file mode 100644 index 0000000..71f3b61 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Gemfile.lock @@ -0,0 +1,185 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.7) + actionview (= 4.2.7) + activesupport (= 4.2.7) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.7) + activesupport (= 4.2.7) + globalid (>= 0.3.0) + activemodel (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + activerecord (4.2.7) + activemodel (= 4.2.7) + activesupport (= 4.2.7) + arel (~> 6.0) + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.4) + bcrypt (3.1.12) + binding_of_caller (0.8.0) + debug_inspector (>= 0.0.1) + builder (3.2.3) + byebug (10.0.2) + client_side_validations (4.2.12) + jquery-rails (>= 3.1.2, < 5.0.0) + js_regex (~> 1.0, >= 1.0.19) + rails (>= 4.0.0, < 4.3.0) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.0.5) + crass (1.0.4) + debug_inspector (0.0.3) + erubis (2.7.0) + execjs (2.7.0) + ffi (1.9.25) + globalid (0.4.1) + activesupport (>= 4.2.0) + hirb (0.7.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + js_regex (1.2.3) + regexp_parser (>= 0.3.6, <= 0.5.0) + json (1.8.6) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + multi_json (1.13.1) + nokogiri (1.8.4) + mini_portile2 (~> 2.3.0) + rack (1.6.10) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.7) + actionmailer (= 4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + activemodel (= 4.2.7) + activerecord (= 4.2.7) + activesupport (= 4.2.7) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.7) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-footnotes (4.1.8) + rails (>= 3.2) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (4.2.7) + actionpack (= 4.2.7) + activesupport (= 4.2.7) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.3.1) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rdoc (4.3.0) + regexp_parser (0.5.0) + sass (3.5.7) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sdoc (0.4.2) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + spring (2.0.2) + activesupport (>= 4.2) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + thor (0.20.0) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.1.1) + turbolinks-source (~> 5.1) + turbolinks-source (5.1.0) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.18) + execjs (>= 0.3.0, < 3) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + bcrypt (~> 3.1.7) + byebug + client_side_validations + coffee-rails (~> 4.1.0) + hirb + jbuilder (~> 2.0) + jquery-rails + rails (= 4.2.7) + rails-footnotes (~> 4.0) + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + sqlite3 + turbolinks + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.16.3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/users/README.rdoc b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/README.rdoc similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/users/README.rdoc rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/README.rdoc diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/Rakefile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Rakefile similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/Rakefile rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/Rakefile diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/assets/images/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/images/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/assets/images/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/images/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/images/codingdojo.png b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/images/codingdojo.png new file mode 100644 index 0000000..5c82e33 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/images/codingdojo.png differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/application.js b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/application.js new file mode 100644 index 0000000..d81f51a --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/dojo.coffee b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/dojo.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/dojo.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/main.js b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/main.js new file mode 100644 index 0000000..9aed150 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/javascripts/main.js @@ -0,0 +1,25 @@ + +// Nav-Shrink +$(document).ready(function() { + $(window).scroll(function() { + if($(document).scrollTop() > 10) { + $('nav').addClass('shrink'); + } + else { + $('nav').removeClass('shrink'); + } + }); +}); + + +// // ??? +// document.addEventListener('DOMContentLoaded', function() { +// var elems = document.querySelectorAll('.scrollspy'); +// var instances = M.ScrollSpy.init(elems, options); +// }); + +// // Or with jQuery + +// $(document).ready(function(){ +// $('.scrollspy').scrollSpy(); +// }); diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/assets/stylesheets/application.css b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/stylesheets/application.css similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/assets/stylesheets/application.css rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/stylesheets/application.css diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/stylesheets/dojo.scss b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/stylesheets/dojo.scss new file mode 100644 index 0000000..20f9380 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/assets/stylesheets/dojo.scss @@ -0,0 +1,144 @@ +// Navbar section +nav { + background-color:#000; + padding: 0 4rem; + a:hover { color: tan; } +} + +body { + width: 100%; + height: 100vh; + // position: static; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-image: url('https://cdn-images-1.medium.com/max/1600/0*zfW13Mn8_fvEKcU7.jpg') +} + +nav a { color: white; } +nav a img { + width: 100px; + height: 40px; + margin: 0.5rem 0; + border-style: none; +} + +nav a:hover { color: #06a9e2; cursor: pointer; } + + +h1, h2 { + font-family: 'Fredoka One', cursive; + text-align: center; + color: #06a9e2; + margin: 4rem 0 2rem; + position: relative; +} +h1 span { color: #06a9e2; font-family: 'Poiret One', cursive; } + +#notice { + padding: 2rem; + border-radius: 1rem; + border: 2px solid #06a9e2; + background: lightslategrey; +} + +// Form Components [ Add and Edit ] Section +form { padding: 0 15rem; } +ul .form-row { padding-left: 4rem !important; } +.form-row { line-height: 0rem; } + + +// Table Section +.theader { color: #06a9e2; font-family: 'Poiret One', cursive; } +.trbody { font-family: 'Poiret One', cursive; } +.trbody > td { padding: 0; } +.trbody > td:last-child > a { margin: 0.1rem auto; width: 5rem; } +.trbody > td:last-child > form { + input { margin: 0; } + width: 5rem; + margin: 0rem auto; + display: inline-table !important; +} +.trbody:hover { color: #06a9e2; background-color: #0000006b !important; } +.scrolling-wrapper { + -webkit-overflow-scrolling: touch; + padding-bottom: 12rem; + overflow-y: scroll; + position:relative; + opacity: 0.8; + height: 50px !important; + width: 100%; + // z-index: -1; + } + ::-webkit-scrollbar { width: 12px; } + ::-webkit-scrollbar-track { display: none; } + + +// Container section +.container { height: 70% !important; width: 50%; background-color: #171414e3; color: #f5f5f5; padding: 4rem 2rem; margin: 0rem auto;} +// .container h1 { margin-top: 2rem; } + +.flxend { display: flex; justify-content: end; } // div container requiring flex +.flexed { display: flex; justify-content: space-between; } // div container requiring flex +.grided { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 2rem; } // div container requiring grid +.inline { display: inline-block; margin: 1rem auto; } // div container requiring grid +.grided input { min-width: 100%; margin-top: 2rem; } +.text-warning { color: #fba153fa; } +.right-margin { margin-right: 1rem; } +.sn { + color: white; + margin-top: 2rem; + border-radius: .2rem; + background-color: #111; + border: 1px solid #f5f5f5; + // background-color: #357ae8; + transition: all .3s ease-in-out; + box-shadow: 1px 2px 2px 0px #444 !important; +} +.sn:hover { + color: #06a9e2; + transition: all .3s ease-in-out; + background-color: #000 !important; + box-shadow: 0px 0px 0px 0px #222 !important; +} +.show { + border-radius: 1rem; + font-size: 10px; + color: #06a9e2; + &:hover { + color: white !important; + background-color: #357ae8 !important; + } +} +.edit { + border-radius: 1rem; + font-size: 10px; + color: lime; + &:hover { + color: white !important; + background-color: green !important; + } +} +.delete { + border-radius: 1rem; + font-size: 10px; + color: #f44336; + &:hover { + color: white !important; + background-color: red !important; + } +} +.brand-logo { + font-family: 'Days One', sans-serif; +} + +input.valid:not([type]), input.valid:not([type]):focus, input.valid[type=text]:not(.browser-default), input.valid[type=text]:not(.browser-default):focus, input.valid[type=password]:not(.browser-default), input.valid[type=password]:not(.browser-default):focus, input.valid[type=email]:not(.browser-default), input.valid[type=email]:not(.browser-default):focus, input.valid[type=url]:not(.browser-default), input.valid[type=url]:not(.browser-default):focus, input.valid[type=time]:not(.browser-default), input.valid[type=time]:not(.browser-default):focus, input.valid[type=date]:not(.browser-default), input.valid[type=date]:not(.browser-default):focus, input.valid[type=datetime]:not(.browser-default), input.valid[type=datetime]:not(.browser-default):focus, input.valid[type=datetime-local]:not(.browser-default), input.valid[type=datetime-local]:not(.browser-default):focus, input.valid[type=tel]:not(.browser-default), input.valid[type=tel]:not(.browser-default):focus, input.valid[type=number]:not(.browser-default), input.valid[type=number]:not(.browser-default):focus, input.valid[type=search]:not(.browser-default), input.valid[type=search]:not(.browser-default):focus, textarea.materialize-textarea.valid, textarea.materialize-textarea.valid:focus, .select-wrapper.valid>input.select-dropdown { + border-bottom: 1px solid #357ae8 !important; + -webkit-box-shadow: 0 1px 0 0 #357ae8 !important; + box-shadow: 0 1px 0 0 #357ae8 !important; +} +input.valid:not([type]), input.valid:not([type]):focus, input.valid[type=text]:not(.browser-default), input.valid[type=text]:not(.browser-default):focus, input.valid[type=password]:not(.browser-default), input.valid[type=password]:not(.browser-default):focus, input.valid[type=email]:not(.browser-default), input.valid[type=email]:not(.browser-default):focus, input.valid[type=url]:not(.browser-default), input.valid[type=url]:not(.browser-default):focus, input.valid[type=time]:not(.browser-default), input.valid[type=time]:not(.browser-default):focus, input.valid[type=date]:not(.browser-default), input.valid[type=date]:not(.browser-default):focus, input.valid[type=datetime]:not(.browser-default), input.valid[type=datetime]:not(.browser-default):focus, input.valid[type=datetime-local]:not(.browser-default), input.valid[type=datetime-local]:not(.browser-default):focus, input.valid[type=tel]:not(.browser-default), input.valid[type=tel]:not(.browser-default):focus, input.valid[type=number]:not(.browser-default), input.valid[type=number]:not(.browser-default):focus, input.valid[type=search]:not(.browser-default), input.valid[type=search]:not(.browser-default):focus, textarea.materialize-textarea.valid, textarea.materialize-textarea.valid:focus, .select-wrapper.valid>input.select-dropdown { + border-bottom: 1px solid #357ae8; + -webkit-box-shadow: 0 1px 0 0 #357ae8; + box-shadow: 0 1px 0 0 #357ae8; +} \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/controllers/application_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/application_controller.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/controllers/application_controller.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/application_controller.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/controllers/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/controllers/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/dojo_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/dojo_controller.rb new file mode 100644 index 0000000..b4cf0a6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/controllers/dojo_controller.rb @@ -0,0 +1,83 @@ +class DojoController < ApplicationController + + before_action :set_dojo, only: [:show, :edit, :update, :destroy] + + # GET Request - Renders root/home page [.html] + def index + @alldojos = Dojo.all + end + + + # GET Request - Renders [.html] + def new + @dojo = Dojo.new + end + + + # POST Request [.html] + # POST Request [.json] + def create + @dojo = Dojo.create(validate_params) + # @dojo.valid? + respond_to do |format| + if @dojo.save + format.html { redirect_to '/', notice: 'Dojo was successfully created.' } + format.json { render :show, status: :created, location: @dojo } + else + format.html { render :new } + format.json { render json: @dojo.errors, status: :unprocessable_entity } + end + end + end + + + # GET Request - Renders [.html] + def show + @dojo = Dojo.find(params[:id]) + end + + + # GET Request - Renders [.html] + def edit + @dojo = Dojo.find(params[:id]) + render "edit" + end + + + # PATCH/PUT Request [.html] + # PATCH/PUT Request [.json] + def update + respond_to do |format| + if @dojo.update(validate_params) + format.html { redirect_to '/', notice: 'Dojo was successfully updated.' } + format.json { render :show, status: :ok, location: @dojo } + else + format.html { render :edit } + format.json { render json: @dojo.errors, status: :unprocessable_entity } + end + end + end + + + # DELETE /dojos/1 + # DELETE /dojos/1.json + def destroy + Dojo.find(params[:id]).destroy + respond_to do |format| + format.html { redirect_to '/', notice: 'Dojo was successfully destroyed.' } + format.json { head :no_content } + end + end + + + private + # Use callbacks to share common setup or constraints between actions. + def set_dojo + @dojo = Dojo.find(params[:id]) + end + + # Sanatizing/Validating Parameters... + def validate_params + params.require(:dojo).permit(:branch, :street, :city, :state) + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/helpers/application_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/helpers/application_helper.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/helpers/application_helper.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/helpers/application_helper.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/helpers/dojo_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/helpers/dojo_helper.rb new file mode 100644 index 0000000..89d551e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/helpers/dojo_helper.rb @@ -0,0 +1,2 @@ +module DojoHelper +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/mailers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/mailers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/mailers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/mailers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/models/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/models/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/models/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/app/models/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/dojo.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/dojo.rb new file mode 100644 index 0000000..54b1dd2 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/models/dojo.rb @@ -0,0 +1,4 @@ +class Dojo < ActiveRecord::Base + validates :branch, :street, :city, :state, presence: true, length: { minimum: 2 } + validates :branch, uniqueness: { case_sensitive: false } +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/views/dojo/edit.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/views/dojo/edit.html.erb new file mode 100644 index 0000000..0d5d461 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/DojoDashBoard/app/views/dojo/edit.html.erb @@ -0,0 +1,59 @@ + + +
<%= notice %>
+ <% end %> + +| Coding Dojo Branch | +Street | +City | +State | +Actions | +
|---|
<%= notice %>
+ <% end %> + +| Street | +City | +State | +
|---|---|---|
| <%= @dojo.street %> | +<%= @dojo.city %> | +<%= @dojo.state %> | +
| Title | +Content | +Author | + + + <% @all_posts.each do |post| %> +
|---|---|---|
| <%= post.title %> | +<%= post.content %> | +<%= post.user.first_name %> <%= post.user.last_name %> | +
Find me in app/views/posts/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/app/views/users/index.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/app/views/users/index.html.erb new file mode 100644 index 0000000..45315d6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/app/views/users/index.html.erb @@ -0,0 +1,38 @@ +<% content_for :left_column do %> +| First Name | +Last Name | +Favorite Language | + + + <% @all_users.each do |user| %> +
|---|---|---|
| <%= user.first_name %> | +<%= user.last_name %> | +<%= user.favorite_language %> | +
Find me in app/views/users/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/bundle similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/bundle rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/bundle diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/rails similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/rails rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/rails diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/rake similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/rake rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/rake diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/setup similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/setup rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/setup diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/spring similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/bin/spring rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/bin/spring diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config.ru similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config.ru rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config.ru diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/application.rb new file mode 100644 index 0000000..0daa42c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module LayoutsAssign + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/boot.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/boot.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/boot.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/database.yml similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/database.yml rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/database.yml diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environment.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environment.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environment.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/development.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/config/environments/development.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/development.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/production.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environments/production.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/production.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/test.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/environments/test.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/environments/test.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/assets.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/config/initializers/assets.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/assets.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/backtrace_silencers.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/backtrace_silencers.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/backtrace_silencers.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/cookies_serializer.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/cookies_serializer.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/cookies_serializer.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/filter_parameter_logging.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/filter_parameter_logging.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/filter_parameter_logging.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/inflections.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/inflections.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/inflections.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/mime_types.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/mime_types.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/mime_types.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/session_store.rb new file mode 100644 index 0000000..fe3aa28 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_LayoutsAssign_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/wrap_parameters.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/initializers/wrap_parameters.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/initializers/wrap_parameters.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/locales/en.yml similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/config/locales/en.yml rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/locales/en.yml diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/routes.rb new file mode 100644 index 0000000..f0d00e3 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/routes.rb @@ -0,0 +1,29 @@ +Rails.application.routes.draw do + + root 'users#index' + + resources :users + resources :posts + + # ================================================================== + # Prefix Verb URI Pattern Controller#Action + # ================================================================== + # root GET / users#index + # users GET /users(.:format) users#index + # POST /users(.:format) users#create + # new_user GET /users/new(.:format) users#new + # edit_user GET /users/:id/edit(.:format) users#edit + # user GET /users/:id(.:format) users#show + # PATCH /users/:id(.:format) users#update + # PUT /users/:id(.:format) users#update + # DELETE /users/:id(.:format) users#destroy + # posts GET /posts(.:format) posts#index + # POST /posts(.:format) posts#create + # new_post GET /posts/new(.:format) posts#new + # edit_post GET /posts/:id/edit(.:format) posts#edit + # post GET /posts/:id(.:format) posts#show + # PATCH /posts/:id(.:format) posts#update + # PUT /posts/:id(.:format) posts#update + # DELETE /posts/:id(.:format) posts#destroy + # ================================================================== +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/secrets.yml new file mode 100644 index 0000000..3fba5b6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: e7fb56f6f2d8f029bbabd776272d06aaed76b28dafbbca15ff3b1f5afd233c00b4c0588fe988475c5117589e3ae70fb73f5b6406e7d00539e48fcfc3a486529b + +test: + secret_key_base: 73d354298a9a39b1d092181aa07c81c97e7bd4755fd20170415d8c850fd2ea6b2deba000ee207299783c2331a7a3ebd7a9a572ba850aa7e586aac1797e7193ab + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001635_create_users.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001635_create_users.rb new file mode 100644 index 0000000..975d52c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001635_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :first_name + t.string :last_name + t.string :favorite_language + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001654_create_posts.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001654_create_posts.rb new file mode 100644 index 0000000..0bd3b70 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/migrate/20180813001654_create_posts.rb @@ -0,0 +1,11 @@ +class CreatePosts < ActiveRecord::Migration + def change + create_table :posts do |t| + t.string :title + t.text :content + t.references :user, index: true, foreign_key: true + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/schema.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/schema.rb new file mode 100644 index 0000000..1459dde --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/schema.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180813001654) do + + create_table "posts", force: :cascade do |t| + t.string "title" + t.text "content" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "posts", ["user_id"], name: "index_posts_on_user_id" + + create_table "users", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.string "favorite_language" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/seeds.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/db/seeds.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/db/seeds.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/lib/assets/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/lib/assets/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/lib/assets/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/lib/tasks/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/lib/tasks/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/lib/tasks/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/log/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/log/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/log/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/404.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/404.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/404.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/422.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/422.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/422.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/422.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/500.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/500.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/500.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/500.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/favicon.ico b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/favicon.ico similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/favicon.ico rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/favicon.ico diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/robots.txt b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/robots.txt similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/public/robots.txt rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/public/robots.txt diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/controllers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/controllers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/posts_controller_test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/posts_controller_test.rb new file mode 100644 index 0000000..2e04f93 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/posts_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class PostsControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get new" do + get :new + assert_response :success + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/users_controller_test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/users_controller_test.rb new file mode 100644 index 0000000..331ec05 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/controllers/users_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get new" do + get :new + assert_response :success + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/fixtures/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/fixtures/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/posts.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/posts.yml new file mode 100644 index 0000000..ad847bc --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/posts.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + content: MyText + user_id: + +two: + title: MyString + content: MyText + user_id: diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/users.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/users.yml new file mode 100644 index 0000000..7cb1841 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + first_name: MyString + last_name: MyString + favorite_language: MyString + +two: + first_name: MyString + last_name: MyString + favorite_language: MyString diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/helpers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/helpers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/helpers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/helpers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/integration/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/integration/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/integration/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/integration/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/mailers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/mailers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/mailers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/mailers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/models/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/models/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/test/models/post_test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/post_test.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_I/test/models/post_test.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/post_test.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/test/models/user_test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/user_test.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/test/models/user_test.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/models/user_test.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/test_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/test_helper.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/test/test_helper.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/test/test_helper.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/vendor/assets/javascripts/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/vendor/assets/javascripts/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/vendor/assets/javascripts/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/vendor/assets/javascripts/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/vendor/assets/stylesheets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/vendor/assets/stylesheets/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/DojoNinjas/vendor/assets/stylesheets/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/LayoutsAssign/vendor/assets/stylesheets/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/.gitignore b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/.gitignore similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/.gitignore rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/.gitignore diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile new file mode 100644 index 0000000..4347ba3 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile @@ -0,0 +1,49 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.7' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.1.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem 'turbolinks' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' +end + +gem 'hirb' +gem 'rails-footnotes', '~> 4.0' \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile.lock b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile.lock new file mode 100644 index 0000000..07d9d03 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Gemfile.lock @@ -0,0 +1,175 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.7) + actionview (= 4.2.7) + activesupport (= 4.2.7) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.7) + activesupport (= 4.2.7) + globalid (>= 0.3.0) + activemodel (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + activerecord (4.2.7) + activemodel (= 4.2.7) + activesupport (= 4.2.7) + arel (~> 6.0) + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.4) + binding_of_caller (0.8.0) + debug_inspector (>= 0.0.1) + builder (3.2.3) + byebug (10.0.2) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.0.5) + crass (1.0.4) + debug_inspector (0.0.3) + erubis (2.7.0) + execjs (2.7.0) + ffi (1.9.25) + globalid (0.4.1) + activesupport (>= 4.2.0) + hirb (0.7.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.6) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + multi_json (1.13.1) + nokogiri (1.8.4) + mini_portile2 (~> 2.3.0) + rack (1.6.10) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.7) + actionmailer (= 4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + activemodel (= 4.2.7) + activerecord (= 4.2.7) + activesupport (= 4.2.7) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.7) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-footnotes (4.1.8) + rails (>= 3.2) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (4.2.7) + actionpack (= 4.2.7) + activesupport (= 4.2.7) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.3.1) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rdoc (4.3.0) + sass (3.5.7) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sdoc (0.4.2) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + spring (2.0.2) + activesupport (>= 4.2) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + thor (0.20.0) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.1.1) + turbolinks-source (~> 5.1) + turbolinks-source (5.1.0) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.17) + execjs (>= 0.3.0, < 3) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + byebug + coffee-rails (~> 4.1.0) + hirb + jbuilder (~> 2.0) + jquery-rails + rails (= 4.2.7) + rails-footnotes (~> 4.0) + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + sqlite3 + turbolinks + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.16.3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/README.rdoc b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/Rakefile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Rakefile similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/Rakefile rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/Rakefile diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/images/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/images/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/casino.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/casino.gif new file mode 100644 index 0000000..5a85634 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/casino.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/cave.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/cave.gif new file mode 100644 index 0000000..fb9d7cf Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/cave.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/codingdojo.png b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/codingdojo.png new file mode 100644 index 0000000..5c82e33 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/codingdojo.png differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/farm.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/farm.gif new file mode 100644 index 0000000..0fcf857 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/farm.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/gold.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/gold.gif new file mode 100644 index 0000000..6556f2b Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/gold.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/house.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/house.gif new file mode 100644 index 0000000..a8a7b01 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/house.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/saiyan_level.gif b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/saiyan_level.gif new file mode 100644 index 0000000..658bfcf Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/images/saiyan_level.gif differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/app/assets/javascripts/application.js b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/javascripts/application.js similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/BlogsPostMsgs_II/app/assets/javascripts/application.js rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/javascripts/application.js diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/javascripts/rpgs.coffee b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/javascripts/rpgs.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/javascripts/rpgs.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/application.css b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/application.css new file mode 100644 index 0000000..baa3982 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/application.css @@ -0,0 +1,71 @@ + +* { + margin: 0px; + padding: 0px; } + +body{ + color: rgb(255, 255, 255); + background: rgb(0, 0, 0); + font-family: 'Montserrat', sans-serif; } + +h3 { + font-family: 'Fredoka One', cursive; + color: rgb(255,190,59); + text-align: center; +} + +h4 { + margin-top: 1rem; +} +.timer { margin-left: 2rem; color: silver; } +.brand-logo { color: #d8cab8cc; font-family: 'Fredoka One', cursive; } +.brand-logo span { color: #f5f5f5 !important; } +.brand-logo span:hover { color: #e6be8ad4 !important; } + +.activities { color: rgb(255,190,59); } + +.red { color: red; } + +.score-img { width: 60px; height: 60px; } + +img{ + width: 250px; + height: 190px; + position: center; } + +.anyClass { + height:150px; + overflow-y: scroll; } + +.btn { + float: left; + width: 100%; + margin-bottom: 1rem; +} + +.mybtn { + width: 100px; + float: right; + margin-top: -2.5rem; +} + +form, h4.activities { + display: block; + text-align: center; +} + +@media (max-width: 1199px) { + .col-md-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + min-width: 50%; + } +} + +@media (max-width: 767px) { + .col-md-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + min-width: 100%; + } +} \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/rpgs.scss b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/rpgs.scss new file mode 100644 index 0000000..03b123b --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/assets/stylesheets/rpgs.scss @@ -0,0 +1,11 @@ + +// .top { margin-bottom: 0; } +// .brand-logo { +// color: #d8cab8cc; +// // color: #f5f5f5 !important; +// font-family: 'Days One', sans-serif; +// span { +// color: #f5f5f5 !important; +// } +// &:hover { color: #e6be8ad4 !important; } +// } \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/controllers/application_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/application_controller.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/controllers/application_controller.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/application_controller.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/controllers/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/controllers/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/rpgs_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/rpgs_controller.rb new file mode 100644 index 0000000..7eced44 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/controllers/rpgs_controller.rb @@ -0,0 +1,57 @@ +class RpgsController < ApplicationController + + @@time = Time.new + + def index + if !session[:activities] and !session[:gold_count] + session[:gold_count] = 0 + session[:activities] = [] + end + render "rpgs/ninjagold" + end + + def process_money + # @now = '{0:%Y-%m-%d %H:%M:%S}'.format(datetime.now()) + @timestamp = @@time.strftime('%Y/%m/%d %H:%M %p') + if 'farm' == params[:gold] + @rand = rand(10..20) + session[:gold_count]+= @rand + session[:activities] << {status:"green", message:" You hav earned #{@rand} gold from the Farm! ", timer:@timestamp} + print "\n\n\nrand_number: #{@rand} - activity: [ #{session[:activities]} ]\n\n\n\n" + + elsif 'cave' == params[:gold] + @rand = rand(5..10) + session[:gold_count]+= @rand + session[:activities] << {status:"green", message:" You hav earned #{@rand} gold from the Cave! ", timer:@timestamp} + + elsif 'house' == params[:gold] + @rand = rand(2..5) + session[:gold_count]+= @rand + session[:activities] << {status:"green", message:" You hav earned #{@rand} gold from the House! ", timer:@timestamp} + + elsif 'casino' == params[:gold] + @luck = rand(0..2) + @rand = rand(0..50) + if @luck == 0 + session[:gold_count]+= @rand + session[:activities] << {status:"green", message:" You hav earned #{@rand} gold from the casino ", timer:@timestamp} + else + if session[:gold_count]-@rand < 0 + session[:gold_count]= 0 + session[:activities] << {status:"red", message:" You have lost all your gold from the casino! ", timer:@timestamp} + else + session[:gold_count]-= @rand + session[:activities] << {status:"red", message:" You have lost #{@rand} gold from the casino ", timer:@timestamp} + end + end + end + + p 'activities', session[:activities] + redirect_to "/" + end + + def reset + session.clear + redirect_to '/' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/helpers/application_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/helpers/application_helper.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/helpers/application_helper.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/helpers/application_helper.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/helpers/rpgs_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/helpers/rpgs_helper.rb new file mode 100644 index 0000000..d6ff991 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/helpers/rpgs_helper.rb @@ -0,0 +1,2 @@ +module RpgsHelper +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/mailers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/mailers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/mailers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/mailers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/models/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/models/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/models/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/models/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/models/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/models/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/models/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/models/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/views/layouts/application.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/views/layouts/application.html.erb new file mode 100644 index 0000000..28064dc --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/NinjaGold/app/views/layouts/application.html.erb @@ -0,0 +1,27 @@ + + + + + + + + +
+ Find me in app/views/says/hello.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/index.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/index.html.erb new file mode 100644 index 0000000..e248fe4 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/index.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/says/index.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/restart.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/restart.html.erb new file mode 100644 index 0000000..38ce823 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/restart.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/says/restart.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/sayhello.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/sayhello.html.erb new file mode 100644 index 0000000..0ae5d14 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/sayhello.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/says/sayhello.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/times.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/times.html.erb new file mode 100644 index 0000000..1a19ed9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/app/views/says/times.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/says/times.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/bundle similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/bundle rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/bundle diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/rails similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/rails rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/rails diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/rake similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/rake rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/rake diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/setup similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/setup rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/setup diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/spring similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/bin/spring rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/bin/spring diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config.ru similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config.ru rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config.ru diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/application.rb new file mode 100644 index 0000000..505c586 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module RoutesAndControllers + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/boot.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/boot.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/boot.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/database.yml similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/database.yml rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/database.yml diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environment.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environment.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environment.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/development.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/config/environments/development.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/development.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/production.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environments/production.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/production.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/test.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/environments/test.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/environments/test.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/assets.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/config/initializers/assets.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/assets.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/backtrace_silencers.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/backtrace_silencers.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/backtrace_silencers.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/cookies_serializer.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/cookies_serializer.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/cookies_serializer.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/filter_parameter_logging.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/filter_parameter_logging.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/filter_parameter_logging.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/inflections.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/inflections.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/inflections.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/mime_types.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/mime_types.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/mime_types.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/session_store.rb new file mode 100644 index 0000000..4dd8057 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_RoutesAndControllers_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/wrap_parameters.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/initializers/wrap_parameters.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/initializers/wrap_parameters.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/locales/en.yml similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/config/locales/en.yml rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/locales/en.yml diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/routes.rb new file mode 100644 index 0000000..ce5384f --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/routes.rb @@ -0,0 +1,63 @@ +Rails.application.routes.draw do + root 'says#index' + get 'say/hello' => 'says#hello' + get 'say/hello/:name' => 'says#sayhello' + get 'say/times' => 'says#times' + get 'say/restart' => 'says#restart' + + + # 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' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/secrets.yml new file mode 100644 index 0000000..ea5bd91 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: d5800e35ff20d95a65e5a319de4cb78900378b8ec72d159bfd16a765b9a99a37c3a6c3eba54bf18f571314767227b345a12e6ae69e718e6cc8f1674cc77a7129 + +test: + secret_key_base: 24c8155cdb85a962678d1d06abfc3a064f9ca6123a260aa15888bf977bc9d6f18e0507cd080d173e647d5cc0b3d698189f23de46491c8184f16528850769e870 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/db/seeds.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/db/seeds.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/db/seeds.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/lib/assets/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/lib/assets/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/lib/assets/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/lib/tasks/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/lib/tasks/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/lib/tasks/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/log/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/log/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/log/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/404.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/404.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/404.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/422.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/422.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/422.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/422.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/500.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/500.html similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/500.html rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/500.html diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/favicon.ico b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/favicon.ico similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/favicon.ico rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/favicon.ico diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/robots.txt b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/robots.txt similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/public/robots.txt rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/public/robots.txt diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/controllers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/controllers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/controllers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/controllers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/controllers/says_controller_test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/controllers/says_controller_test.rb new file mode 100644 index 0000000..22c9437 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/controllers/says_controller_test.rb @@ -0,0 +1,29 @@ +require 'test_helper' + +class SaysControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get hello" do + get :hello + assert_response :success + end + + test "should get sayhello" do + get :sayhello + assert_response :success + end + + test "should get times" do + get :times + assert_response :success + end + + test "should get restart" do + get :restart + assert_response :success + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/fixtures/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/fixtures/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/fixtures/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/fixtures/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/helpers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/helpers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/helpers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/helpers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/integration/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/integration/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/integration/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/integration/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/mailers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/mailers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/mailers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/mailers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/models/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/models/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/models/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/models/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/test_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/test_helper.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/test/test_helper.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/test/test_helper.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/vendor/assets/javascripts/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/vendor/assets/javascripts/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/vendor/assets/javascripts/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/vendor/assets/javascripts/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/vendor/assets/stylesheets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/vendor/assets/stylesheets/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Instagram_SelfJoin/vendor/assets/stylesheets/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/RoutesAndControllers/vendor/assets/stylesheets/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/.gitignore b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/.gitignore similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/.gitignore rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/.gitignore diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile new file mode 100644 index 0000000..8158dac --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile @@ -0,0 +1,63 @@ +source 'https://rubygems.org' + + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.2.7' + +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.1.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks +gem 'turbolinks' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0', group: :doc + +# Use ActiveModel has_secure_password +gem 'bcrypt', '~> 3.1.7' + +# Use Unicorn as the app server +# gem 'unicorn' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug' +end + +group :development do + # Access an IRB console on exception pages or by using <%= console %> in views + gem 'web-console', '~> 2.0' + + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' +end + +gem 'hirb' +# gem 'client_side_validations' +gem 'rails-footnotes', '~> 4.0' + +gem 'nokogiri' +gem 'rack', '~> 2.0.1' +gem 'rspec' + +group :development do + # Use sqlite3 as the database for Active Record + gem 'sqlite3' +end + +group :production do + gem 'pg' + gem 'rails_12factor' +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile.lock b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile.lock new file mode 100644 index 0000000..9a2fcaa --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Gemfile.lock @@ -0,0 +1,185 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.7) + actionview (= 4.2.7) + activesupport (= 4.2.7) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.7) + activesupport (= 4.2.7) + globalid (>= 0.3.0) + activemodel (4.2.7) + activesupport (= 4.2.7) + builder (~> 3.1) + activerecord (4.2.7) + activemodel (= 4.2.7) + activesupport (= 4.2.7) + arel (~> 6.0) + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.4) + bcrypt (3.1.12) + binding_of_caller (0.8.0) + debug_inspector (>= 0.0.1) + builder (3.2.3) + byebug (10.0.2) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.0.5) + crass (1.0.4) + debug_inspector (0.0.3) + erubis (2.7.0) + execjs (2.7.0) + ffi (1.9.25) + globalid (0.4.1) + activesupport (>= 4.2.0) + hirb (0.7.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jbuilder (2.7.0) + activesupport (>= 4.2.0) + multi_json (>= 1.2) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.6) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + multi_json (1.13.1) + nokogiri (1.8.4) + mini_portile2 (~> 2.3.0) + pg (1.0.0) + rack (1.6.10) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.7) + actionmailer (= 4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + activemodel (= 4.2.7) + activerecord (= 4.2.7) + activesupport (= 4.2.7) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.7) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-footnotes (4.1.8) + rails (>= 3.2) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) + railties (4.2.7) + actionpack (= 4.2.7) + activesupport (= 4.2.7) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.3.1) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rdoc (4.3.0) + sass (3.5.7) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sdoc (0.4.2) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) + spring (2.0.2) + activesupport (>= 4.2) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + thor (0.20.0) + thread_safe (0.3.6) + tilt (2.0.8) + turbolinks (5.1.1) + turbolinks-source (~> 5.1) + turbolinks-source (5.1.0) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uglifier (4.1.18) + execjs (>= 0.3.0, < 3) + web-console (2.3.0) + activemodel (>= 4.0) + binding_of_caller (>= 0.7.2) + railties (>= 4.0) + sprockets-rails (>= 2.0, < 4.0) + +PLATFORMS + ruby + +DEPENDENCIES + bcrypt (~> 3.1.7) + byebug + coffee-rails (~> 4.1.0) + hirb + jbuilder (~> 2.0) + jquery-rails + pg + rails (= 4.2.7) + rails-footnotes (~> 4.0) + rails_12factor + sass-rails (~> 5.0) + sdoc (~> 0.4.0) + spring + sqlite3 + turbolinks + uglifier (>= 1.3.0) + web-console (~> 2.0) + +BUNDLED WITH + 1.16.3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/README.rdoc b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/Rakefile b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Rakefile similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/Rakefile rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/Rakefile diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/assets/images/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/images/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/assets/images/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/images/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/images/codingdojo.png b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/images/codingdojo.png new file mode 100644 index 0000000..5c82e33 Binary files /dev/null and b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/images/codingdojo.png differ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/javascripts/application.js b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/application.js similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/javascripts/application.js rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/application.js diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/dojo.coffee b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/dojo.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/dojo.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/main.js b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/main.js new file mode 100644 index 0000000..125462e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/main.js @@ -0,0 +1,11 @@ +document.addEventListener('DOMContentLoaded', function() { + var elems = document.querySelectorAll('select'); + var instances = M.FormSelect.init(elems, options); + }); + + // Or with jQuery + + $(document).ready(function(){ + // alert("Well passed....!") + $('select').formSelect(); + }); \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/students.coffee b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/students.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/javascripts/students.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/stylesheets/application.css b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/application.css similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Friendships_SelfJoin/app/assets/stylesheets/application.css rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/application.css diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/dojo.scss b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/dojo.scss new file mode 100644 index 0000000..ee4f4c7 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/dojo.scss @@ -0,0 +1,199 @@ +// Navbar section +nav { + background-color:#000; + padding: 0 4rem; + a:hover { color: tan; } +} + +body { + width: 100%; + height: 100vh; + // position: static; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-image: url('https://cdn-images-1.medium.com/max/1600/0*zfW13Mn8_fvEKcU7.jpg') +} + +nav a { color: white; } +nav a img { + width: 100px; + height: 40px; + margin: 0.5rem 0; + border-style: none; +} + +nav a:hover { color: #06a9e2; cursor: pointer; } + +h1, h2, .student_header { + font-family: 'Fredoka One', cursive; + text-align: center; + color: #06a9e2; + margin: 4rem 0 2rem; + position: relative; +} +h1 span { color: #06a9e2; font-family: 'Poiret One', cursive; } + +#notice { + padding: 0.5rem 2rem; + border-radius: 1rem; + border: 2px solid #06a9e2; + background: lightslategrey; +} + +// Form Components [ Add and Edit ] Section +form { padding: 0 15rem; } +ul .form-row { padding-left: 4rem !important; } +.form-row { line-height: 0rem; } + + +// Table Section +.theader { color: #06a9e2; font-family: 'Poiret One', cursive; } +.trbody { font-family: 'Poiret One', cursive; } +.trbody > td { padding: 0; } +.trbody > td:last-child > a { margin: 0.1rem auto; width: 5rem; } +.trbody > td:last-child > form { + input { margin: 0; } + width: 5rem; + margin: 0rem auto; + display: inline-table !important; +} +.trbody:hover { color: #06a9e2; background-color: #0000006b !important; } +.scrolling-wrapper { + -webkit-overflow-scrolling: touch; + padding-bottom: 12rem; + overflow-y: scroll; + position:relative; + opacity: 0.8; + height: 50px !important; + width: 100%; + // z-index: -1; + } + ::-webkit-scrollbar { width: 12px; } + ::-webkit-scrollbar-track { display: none; } + + +// Container section +.container { min-height: 70% !important; width: 58%; background-color: #171414e3; color: #f5f5f5; padding: 4rem 2rem; margin: 0rem auto; position: relative;} +.container-min { height: 550px; min-height: 70%; width: 50%; background-color: #171414e3; color: #f5f5f5; padding: 4rem 2rem; margin: 0rem auto; position: relative;} +.container-max { height: 600px; min-height: 70%; width: 50%; background-color: #171414e3; color: #f5f5f5; padding: 4rem 2rem; margin: 0rem auto; position: relative;} +// .container h1 { margin-top: 2rem; } + +.flxend { display: flex; justify-content: end; } // div container requiring flex +.flexed { display: flex; justify-content: space-between; } // div container requiring flex +.grided { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 2rem; } // div container requiring grid +.inline { display: inline-block; margin: 1rem auto; } // div container requiring grid +.grided input { min-width: 100%; margin-top: 2rem; } +.text-warning { color: #fba153fa; } + +// Custom Margin +// =========================== [ 1rem ] +.right-margin1 { margin-right : 1rem !important; } +.left-margin1 { margin-left : 1rem !important; } +.top-margin1 { margin-top : 1rem !important; } +.bottom-margin1 { margin-bottom: 1rem !important; } +// =========================== [ 2rem ] +.right-margin2 { margin-right : 2rem !important; } +.left-margin2 { margin-left : 2rem !important; } +.top-margin2 { margin-top : 2rem !important; } +.bottom-margin2 { margin-bottom: 2rem !important; } +// =========================== [ 4rem ] +.right-margin4 { margin-right : 4rem !important; } +.left-margin4 { margin-left : 4rem !important; } +.top-margin4 { margin-top : 4rem !important; } +.bottom-margin4 { margin-bottom: 4rem !important; } +// =========================== [ 6rem ] +.right-margin6 { margin-right : 6rem !important; } +.left-margin6 { margin-left : 6rem !important; } +.top-margin6 { margin-top : 6rem !important; } +.bottom-margin6 { margin-bottom: 6rem !important; } + +.separator-bar{ margin: 0 1rem; } +.sn { + color: white; + // margin-top: 2rem; + border-radius: .2rem; + background-color: #111; + border: 1px solid #f5f5f5; + // background-color: #357ae8; + transition: all .3s ease-in-out; + box-shadow: 1px 2px 2px 0px #444 !important; +} +.sn:hover { + color: #06a9e2; + transition: all .3s ease-in-out; + background-color: #000 !important; + box-shadow: 0px 0px 0px 0px #222 !important; +} +.show { + border-radius: 1rem; + font-size: 10px; + color: #06a9e2; + &:hover { + color: white !important; + background-color: #357ae8 !important; + } +} +.edit { + border-radius: 1rem; + font-size: 10px; + color: lime; + &:hover { + color: white !important; + background-color: green !important; + } +} +.delete { + border-radius: 1rem; + font-size: 10px; + color: #f44336; + &:hover { + color: white !important; + background-color: red !important; + } +} +.brand-logo { + font-family: 'Days One', sans-serif; +} + +input.valid:not([type]), input.valid:not([type]):focus, input.valid[type=text]:not(.browser-default), input.valid[type=text]:not(.browser-default):focus, input.valid[type=password]:not(.browser-default), input.valid[type=password]:not(.browser-default):focus, input.valid[type=email]:not(.browser-default), input.valid[type=email]:not(.browser-default):focus, input.valid[type=url]:not(.browser-default), input.valid[type=url]:not(.browser-default):focus, input.valid[type=time]:not(.browser-default), input.valid[type=time]:not(.browser-default):focus, input.valid[type=date]:not(.browser-default), input.valid[type=date]:not(.browser-default):focus, input.valid[type=datetime]:not(.browser-default), input.valid[type=datetime]:not(.browser-default):focus, input.valid[type=datetime-local]:not(.browser-default), input.valid[type=datetime-local]:not(.browser-default):focus, input.valid[type=tel]:not(.browser-default), input.valid[type=tel]:not(.browser-default):focus, input.valid[type=number]:not(.browser-default), input.valid[type=number]:not(.browser-default):focus, input.valid[type=search]:not(.browser-default), input.valid[type=search]:not(.browser-default):focus, textarea.materialize-textarea.valid, textarea.materialize-textarea.valid:focus, .select-wrapper.valid>input.select-dropdown { + border-bottom: 1px solid #06a9e2 !important; + -webkit-box-shadow: 0 1px 0 0 #06a9e2 !important; + box-shadow: 0 1px 0 0 #06a9e2 !important; +} +input:not([type]):focus:not([readonly]), input[type=text]:not(.browser-default):focus:not([readonly]), input[type=password]:not(.browser-default):focus:not([readonly]), input[type=email]:not(.browser-default):focus:not([readonly]), input[type=url]:not(.browser-default):focus:not([readonly]), input[type=time]:not(.browser-default):focus:not([readonly]), input[type=date]:not(.browser-default):focus:not([readonly]), input[type=datetime]:not(.browser-default):focus:not([readonly]), input[type=datetime-local]:not(.browser-default):focus:not([readonly]), input[type=tel]:not(.browser-default):focus:not([readonly]), input[type=number]:not(.browser-default):focus:not([readonly]), input[type=search]:not(.browser-default):focus:not([readonly]), textarea.materialize-textarea:focus:not([readonly]) { + border-bottom: 1px solid #06a9e2; + -webkit-box-shadow: 0 1px 0 0 #06a9e2; + box-shadow: 0 1px 0 0 #06a9e2; +} +.dropdown-content li>a, .dropdown-content li>span { + font-size: 16px; + background-color: #020000; + color: #9e9e9edb; + display: block; + line-height: 22px; + padding: 14px 16px; +} +.dropdown-content li>a:hover, .dropdown-content li>span:hover { + background-color: #06a9e2; + color: white; +} + + +.select-wrapper input.select-dropdown { + color: #06a9e2; +} +input:not([type]):focus:not([readonly])+label,.form-wrap input[type=text]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=password]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=email]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=url]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=time]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=date]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=datetime]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=datetime-local]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=tel]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=number]:not(.browser-default):focus:not([readonly])+label,.form-wrap input[type=search]:not(.browser-default):focus:not([readonly])+label,.form-wrap textarea.materialize-textarea:focus:not([readonly])+label { + color: #06a9e2; +} +input:not([type]):focus:not([readonly])+label, input[type=text]:not(.browser-default):focus:not([readonly])+label, input[type=password]:not(.browser-default):focus:not([readonly])+label, input[type=email]:not(.browser-default):focus:not([readonly])+label, input[type=url]:not(.browser-default):focus:not([readonly])+label, input[type=time]:not(.browser-default):focus:not([readonly])+label, input[type=date]:not(.browser-default):focus:not([readonly])+label, input[type=datetime]:not(.browser-default):focus:not([readonly])+label, input[type=datetime-local]:not(.browser-default):focus:not([readonly])+label, input[type=tel]:not(.browser-default):focus:not([readonly])+label, input[type=number]:not(.browser-default):focus:not([readonly])+label, input[type=search]:not(.browser-default):focus:not([readonly])+label, textarea.materialize-textarea:focus:not([readonly])+label { + color: #06a9e2; +} +.select-wrapper input.select-dropdown { color: #06a9e2 !important; } +.select-wrapper input.select-dropdown:focus { + border-bottom: 2px solid #06a9e2 !important; +} +// label:active { +// font-size: .8rem; +// color: #06a9e2 !important; +// } diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/students.scss b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/students.scss new file mode 100644 index 0000000..f5e154d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/assets/stylesheets/students.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Students controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/controllers/application_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/application_controller.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/controllers/application_controller.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/application_controller.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/controllers/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/controllers/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/dojo_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/dojo_controller.rb new file mode 100644 index 0000000..daa26ea --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/dojo_controller.rb @@ -0,0 +1,110 @@ +class DojoController < ApplicationController + + before_action :set_dojo, only: [:show, :edit, :update, :destroy] + + # ============================================ + # GET Request - Renders root/home page [.html] + # ============================================ + def index + # --- [ Put in Session ] + session[:page] = "dojo" + # --------------------- + @alldojos = Dojo.all + end + + + # ============================= + # GET Request - Renders [.html] + # ============================= + def new + # --- [ Put in Session ] + session[:page] = "dojo" + # --------------------- + @dojo = Dojo.new + end + + + # ==================== + # POST Request [.html] + # POST Request [.json] + # ==================== + def create + @dojo = Dojo.create(validate_params) + # @dojo.valid? + respond_to do |format| + if @dojo.save + format.html { redirect_to '/', notice: 'Dojo was successfully created.' } + format.json { render :show, status: :created, location: @dojo } + else + format.html { render :new } + format.json { render json: @dojo.errors, status: :unprocessable_entity } + end + end + end + + + # ============================= + # GET Request - Renders [.html] + # ============================= + def show + # --- [ Put in Session ] + session[:page] = "dojo" + # --------------------- + @dojo = Dojo.find(params[:id]) + @students = @dojo.students.order(:last_name) + end + + + # ============================= + # GET Request - Renders [.html] + # ============================= + def edit + # --- [ Put in Session ] + session[:page] = "dojo" + # --------------------- + @dojo = Dojo.find(params[:id]) + render "edit" + end + + + # ========================= + # PATCH/PUT Request [.html] + # PATCH/PUT Request [.json] + # ========================= + def update + respond_to do |format| + if @dojo.update(validate_params) + format.html { redirect_to '/', notice: 'Dojo was successfully updated.' } + format.json { render :show, status: :ok, location: @dojo } + else + format.html { render :edit } + format.json { render json: @dojo.errors, status: :unprocessable_entity } + end + end + end + + + # ==================== + # DELETE /dojos/1 + # DELETE /dojos/1.json + # ==================== + def destroy + Dojo.find(params[:id]).destroy + respond_to do |format| + format.html { redirect_to '/', notice: 'Dojo was successfully destroyed.' } + format.json { head :no_content } + end + end + + + private + # Use callbacks to share common setup or constraints between actions. + def set_dojo + @dojo = Dojo.find(params[:id]) + end + + # Sanatizing/Validating Parameters... + def validate_params + params.require(:dojo).permit(:branch, :street, :city, :state) + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/students_controller.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/students_controller.rb new file mode 100644 index 0000000..e8ff2b6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/controllers/students_controller.rb @@ -0,0 +1,119 @@ +class StudentsController < ApplicationController + + before_action :set_student, only: [:first_name, :last_name, :email, :dojo_id] + + # ============================= + # GET Request - Renders [.html] + # ============================= + def new + @dojos = Dojo.all + @student = Student.new + @this_dojo = Dojo.find(params[:dojo_id]) + + # ----------- [ Put in Session ] + session[:page] = "student" + session[:dojoid] = @this_dojo.id + # ------------------------------ + end + + + # ==================== + # POST Request [.html] + # POST Request [.json] + # ==================== + def create + @student = Student.create(validate_params) + # @student.valid? + respond_to do |format| + if @student.save + # format.html { redirect_to dojo_student_url, notice: 'Student was successfully created.' } + format.html { redirect_to "/dojo/#{params[:dojo_id]}", notice: 'Student was successfully created.' } + format.json { render :show, status: :created, location: @student } + else + format.html { render "students/new" } + format.json { render json: @student.errors, status: :unprocessable_entity } + end + end + end + + + # ============================= + # GET Request - Renders [.html] + # ============================= + def show + @student = Student.find(params[:id]) + @this_dojo = Dojo.find(params[:dojo_id]) + @this_student = "#{@student.first_name} #{@student.last_name}" + + # ----------- [ Put in Session ] + session[:page] = "student" + session[:dojoid] = @this_dojo.id + # ------------------------------ + # print "\n\n\n=========\n", @dojo + # print "\n\n\n=========\n", @student + end + + + # ============================= + # GET Request - Renders [.html] + # ============================= + def edit + @alldojos = Dojo.all + @edit_dojo = Dojo.find(params[:dojo_id]) + @student = Student.find(params[:id]) + @this_student = "#{@student.first_name} #{@student.last_name}" + + # -------------------------------- [ Put in Session ] + session[:page] = "student" + session[:dojo_id] = params[:dojo_id] + session[:student_id] = params[:id] + session[:branch] = Dojo.find(params[:dojo_id]).branch + # --------------------------------------------------- + render "edit" + end + + + # ========================= + # PATCH/PUT Request [.html] + # PATCH/PUT Request [.json] + # ========================= + def update + @student = Student.find(params[:id]) + respond_to do |format| + if @student.update(validate_params) + # format.html { redirect_to dojo_student_url, notice: 'Student was successfully updated.' } + format.html { redirect_to "/dojo/#{params[:dojo_id]}/students/#{params[:id]}", notice: 'Student was successfully updated.' } + format.json { render :show, status: :ok, location: @student } + else + format.html { render :edit } + format.json { render json: @student.errors, status: :unprocessable_entity } + end + end + end + + + # ====================== + # DELETE /student/1 + # DELETE /student/1.json + # ====================== + def destroy + Student.find(params[:id]).destroy + respond_to do |format| + # format.html { redirect_to '/', notice: 'Student was successfully destroyed.' } + format.html { redirect_to "/dojo/#{params[:dojo_id]}", notice: 'Student was successfully deleted.' } + format.json { head :no_content } + end + end + + + private + # Use callbacks to share common setup or constraints between actions. + def set_student + @student = Student.find(params[:id]) + end + + # Sanatizing/Validating Parameters... + def validate_params + params.require(:student).permit(:first_name, :last_name, :email, :dojo_id) + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/helpers/application_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/application_helper.rb similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/helpers/application_helper.rb rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/application_helper.rb diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/dojo_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/dojo_helper.rb new file mode 100644 index 0000000..89d551e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/dojo_helper.rb @@ -0,0 +1,2 @@ +module DojoHelper +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/students_helper.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/students_helper.rb new file mode 100644 index 0000000..6191d9e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/helpers/students_helper.rb @@ -0,0 +1,2 @@ +module StudentsHelper +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/mailers/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/mailers/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/mailers/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/mailers/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/models/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/models/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/models/concerns/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/concerns/.keep similarity index 100% rename from ObiFenix-RubyStack/Ruby-Stack/Rails/Polymorphism/app/models/concerns/.keep rename to ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/concerns/.keep diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/dojo.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/dojo.rb new file mode 100644 index 0000000..78ca267 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/dojo.rb @@ -0,0 +1,5 @@ +class Dojo < ActiveRecord::Base + has_many :students, :dependent => :destroy + validates :branch, :street, :city, :state, presence: true, length: { minimum: 2 } + validates :branch, uniqueness: { case_sensitive: false } +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/student.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/student.rb new file mode 100644 index 0000000..a3f6f61 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/models/student.rb @@ -0,0 +1,5 @@ +class Student < ActiveRecord::Base + belongs_to :dojo + validates :first_name, :last_name, :email, presence: true, length: { in: 2..25 } + validates :email, uniqueness: { case_sensitive: false } +end \ No newline at end of file diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/views/dojo/edit.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/views/dojo/edit.html.erb new file mode 100644 index 0000000..59c548f --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/Controllers/StudentDashboard/app/views/dojo/edit.html.erb @@ -0,0 +1,59 @@ + + +<%= notice %>
+ <% end %> + +| Coding Dojo Branch | +Street | +City | +State | +Actions | +
|---|
<%= notice %>
+ <% end %> + +| First Name | +Last Name | +Actions | +
|---|
<%= notice %>
+ <% end %> + + +| First Name | +Last Name | +|
|---|---|---|
| <%= student.first_name %> | +<%= student.last_name %> | +<%= student.email %> | +
+ <%= notice %>
+ <% end %> + +| Name | +Date | +Location | +Host | +Actions/Status | +
|---|
<%= notice %>
+ <% end %> + +| Name | +Date | +Location | +Host | +Actions/Status | +|
|---|---|---|---|---|---|
| <%= event.name %> | +<%= event.date %> | +<%= event.city %> | +<%= event.state %> | +<%= event.user.first_name %> | ++ Join + Edit + <%= link_to "Log out", "/logout", data: { method: :delete, confirm: "Are you sure?"} %> + | +
| Name | +Location | +State | +
|---|---|---|
| + <%= attendee.user.first_name %> + <%= attendee.user.last_name %> + | +<%= attendee.user.city %> | +<%= attendee.user.state %> | +
I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.
++ Don't have an account yet? + Create one now! +
++ Already have an account? + Login now! +
+<%= notice %>
<% end %> + <% if session['form'] == 'login' %><%= render "login_form" %> + <% else %> <%= render "register_form" %> + <% end %> +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+Find me in app/views/likes/dislike.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/likes/like.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/likes/like.html.erb new file mode 100644 index 0000000..1fdcef8 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/likes/like.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/likes/like.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/create.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/create.html.erb new file mode 100644 index 0000000..73239a1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/create.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/secrets/create.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/destroy.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/destroy.html.erb new file mode 100644 index 0000000..c737229 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/destroy.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/secrets/destroy.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/like.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/like.html.erb new file mode 100644 index 0000000..655d4c7 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/like.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/secrets/like.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/new.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/new.html.erb new file mode 100644 index 0000000..fa9bce0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/secrets/new.html.erb @@ -0,0 +1,2 @@ +Find me in app/views/secrets/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/sessions/_login_form.html.erb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/sessions/_login_form.html.erb new file mode 100644 index 0000000..6dd6e1d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/app/views/sessions/_login_form.html.erb @@ -0,0 +1,35 @@ ++ Don't have an account yet? + Create one now! +
++ Already have an account? + Login now! +
+<%= notice %>
<% end %> + <%= render "register_form" %> +Find me in app/views/users/edit.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/application.rb new file mode 100644 index 0000000..7b88c7a --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/application.rb @@ -0,0 +1,35 @@ +require File.expand_path('../boot', __FILE__) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module DojoSecrets + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/database.yml new file mode 100644 index 0000000..06981ca --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/database.yml @@ -0,0 +1,85 @@ +# PostgreSQL. Versions 8.2 and up are supported. +# +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: 5 + +development: + <<: *default + database: DojoSecrets_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: DojoSecrets + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: DojoSecrets_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: DojoSecrets_production + username: DojoSecrets + password: <%= ENV['DOJOSECRETS_DATABASE_PASSWORD'] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/assets.rb new file mode 100644 index 0000000..70f4c58 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# 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( main.js ) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/session_store.rb new file mode 100644 index 0000000..745fa7c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_DojoSecrets_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/routes.rb new file mode 100644 index 0000000..8e1e0b4 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/DojoSecrets/config/routes.rb @@ -0,0 +1,23 @@ +Rails.application.routes.draw do + + # Sessions Routes + root 'sessions#new' + post 'sessions' => 'sessions#login' + delete'/logout' => 'sessions#logout' + + # Users Routes + get 'users/new' => 'users#new' + post 'users/' => 'users#register' + get 'users/:id' => 'users#profile' + get 'users/:id/edit' => 'users#edit' + patch 'users/:id/update' => 'users#update' + + # Secret Routes + get 'secrets' => 'secrets#index' + post 'secrets' => 'secrets#post' + delete'secrets/:id' => 'secrets#delete' + post 'secrets/:id/like' => 'likes#like' # Likes Rout forYou may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+Find me in app/views/users/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/application.rb new file mode 100644 index 0000000..e999553 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/application.rb @@ -0,0 +1,35 @@ +require File.expand_path('../boot', __FILE__) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module TestingFactoryApp + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# 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 ) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/session_store.rb new file mode 100644 index 0000000..235f41f --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_TestingFactoryApp_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/routes.rb new file mode 100644 index 0000000..1f1851d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/routes.rb @@ -0,0 +1,6 @@ +Rails.application.routes.draw do + + # get 'users/new' + resources :users + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/secrets.yml new file mode 100644 index 0000000..fe7398d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: a4443993792bd3a9bb69b3fc88dddc862d779f6fd58fa5030cff729e127cee4f46ea0f491b049f3d0c1e5343fdbcad22cb70beab21685c79240e90e568ea72ce + +test: + secret_key_base: 8dd0c664e8f269196820d1151b9fcf1311e93421df4fc1a7414054a5160f1c99c0608fec148d20dbbbe7fc6d54f2aaf519e943aedddb58ebffaf23951d9815c4 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/migrate/20180813183509_create_users.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/migrate/20180813183509_create_users.rb new file mode 100644 index 0000000..cc285fe --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/migrate/20180813183509_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :first_name + t.string :last_name + t.string :email + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/schema.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/schema.rb new file mode 100644 index 0000000..0ed6414 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/schema.rb @@ -0,0 +1,24 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180813183509) do + + create_table "users", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RailsTDD/Capybara/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+<%= e %>
+ <% end %> + <% end %> + +<%= elem.message %>
+ +<%= comment.content %>
+ <% end %> + + + <% end %> +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+Find me in app/views/sessions/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/application.rb new file mode 100644 index 0000000..7b88c7a --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/application.rb @@ -0,0 +1,35 @@ +require File.expand_path('../boot', __FILE__) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module DojoSecrets + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/database.yml new file mode 100644 index 0000000..d6af69f --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/database.yml @@ -0,0 +1,85 @@ +# PostgreSQL. Versions 8.2 and up are supported. +# +# Install the pg driver: +# gem install pg +# On OS X with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On OS X with MacPorts: +# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem 'pg' +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see rails configuration guide + # http://guides.rubyonrails.org/configuring.html#database-pooling + pool: 5 + +development: + <<: *default + database: DSecrets_development + + # The specified database role being used to connect to postgres. + # To create additional roles in postgres see `$ createuser --help`. + # When left blank, postgres will use the default role. This is + # the same name as the operating system user that initialized the database. + #username: DojoSecrets + + # The password associated with the postgres role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: DSecrets_test + +# As with config/secrets.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password as a unix environment variable when you boot +# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full rundown on how to provide these environment variables in a +# production deployment. +# +# On Heroku and other platform providers, you may have a full connection URL +# available as an environment variable. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# You can use this database configuration with: +# +# production: +# url: <%= ENV['DATABASE_URL'] %> +# +production: + <<: *default + database: DojoSecrets_production + username: DojoSecrets + password: <%= ENV['DOJOSECRETS_DATABASE_PASSWORD'] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/assets.rb new file mode 100644 index 0000000..70f4c58 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# 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( main.js ) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/session_store.rb new file mode 100644 index 0000000..745fa7c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_DojoSecrets_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/routes.rb new file mode 100644 index 0000000..3ae112d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/routes.rb @@ -0,0 +1,60 @@ +Rails.application.routes.draw do + root 'sessions#new' + post 'sessions/login' => 'sessions#login' + get 'sessions/logout' => 'sessions#logout' + + # 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' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/secrets.yml new file mode 100644 index 0000000..7df7aba --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 3204f4d57d46dfaa6a93587e07c03528d342a085923acd7890541abb03e99889a1c8f5b436ac6b651546fc266d20923a533a93bc6894e101c209dbb32eb33966 + +test: + secret_key_base: f6bb8f2cb55ddc4e89aa62b7bbff7a37f1dff56a0ceedba29636cabdd21f3ed28459f27be00fa5497661aaa5391d74304bbb1c9ca911be130b93b87d36dc3d3f + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/migrate/20180815181313_create_users.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/migrate/20180815181313_create_users.rb new file mode 100644 index 0000000..c9fe2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/migrate/20180815181313_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + t.string :password_digest + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/schema.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/schema.rb new file mode 100644 index 0000000..4c55fb2 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/schema.rb @@ -0,0 +1,27 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180815181313) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "users", force: :cascade do |t| + t.string "name" + t.string "email" + t.string "password_digest" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/TDD/RubyTDD/DojoSecrets/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+@ <%= anime.title %>
+ <% end %><% end %> +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+<%= notice %>
+ +| First name | +Last name | +Age | ++ | |||
|---|---|---|---|---|---|---|
| <%= user.first_name %> | +<%= user.last_name %> | +<%= user.email %> | +<%= user.age %> | +<%= link_to 'Show', user %> | +<%= link_to 'Edit', edit_user_path(user) %> | +<%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %> | +
<%= notice %>
+ ++ First name: + <%= @user.first_name %> +
+ ++ Last name: + <%= @user.last_name %> +
+ ++ Email: + <%= @user.email %> +
+ ++ Age: + <%= @user.age %> +
+ +<%= link_to 'Edit', edit_user_path(@user) %> | +<%= link_to 'Back', users_path %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/app/views/users/show.json.jbuilder b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/app/views/users/show.json.jbuilder new file mode 100644 index 0000000..ff40bb9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/app/views/users/show.json.jbuilder @@ -0,0 +1 @@ +json.partial! "users/user", user: @user diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/application.rb new file mode 100644 index 0000000..b90f059 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Scaffolding + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# 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 ) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/session_store.rb new file mode 100644 index 0000000..f55da0d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_Scaffolding_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/routes.rb new file mode 100644 index 0000000..3cfaf1c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/routes.rb @@ -0,0 +1,57 @@ +Rails.application.routes.draw do + resources :users + # 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' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/secrets.yml new file mode 100644 index 0000000..e8c956d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 16cea39ced3a7e700ed5287fd17f5a4ea9e9bbe4e6ff982f100b10435bd5b043c5c32d939c51be202b2ba99f7571aa0be4c5d6f0af6ce8af9b4cfc623465e394 + +test: + secret_key_base: 4863fd78afe13f793d9980b6e3779fcc9b6326460f87dd0f95547c8f4aa65645a539c946e33ca7590e3326385dce8147fa90005288080dcba095ac2c1d122a79 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/migrate/20180808175623_create_users.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/migrate/20180808175623_create_users.rb new file mode 100644 index 0000000..648f540 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/migrate/20180808175623_create_users.rb @@ -0,0 +1,12 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :first_name + t.string :last_name + t.string :email + t.integer :age + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/schema.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/schema.rb new file mode 100644 index 0000000..94e93ed --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/schema.rb @@ -0,0 +1,25 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180808175623) do + + create_table "users", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.string "email" + t.integer "age" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/Scaffolding/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+Find me in app/views/users/new.html.erb
diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/bundle b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rails b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rails new file mode 100755 index 0000000..0138d79 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rake b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rake new file mode 100755 index 0000000..d87d5f5 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/rake @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/setup b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/setup new file mode 100755 index 0000000..acdb2c1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/spring b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/spring new file mode 100755 index 0000000..fb2ec2e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/bin/spring @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. + +unless defined?(Spring) + require 'rubygems' + require 'bundler' + + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config.ru b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config.ru new file mode 100644 index 0000000..bd83b25 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/application.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/application.rb new file mode 100644 index 0000000..e999553 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/application.rb @@ -0,0 +1,35 @@ +require File.expand_path('../boot', __FILE__) + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_view/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module TestingFactoryApp + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/boot.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/boot.rb new file mode 100644 index 0000000..6b750f0 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/database.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environment.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/development.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/development.rb new file mode 100644 index 0000000..b55e214 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/production.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/production.rb new file mode 100644 index 0000000..5c1b32e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/test.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/test.rb new file mode 100644 index 0000000..1c19f08 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/assets.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/assets.rb new file mode 100644 index 0000000..01ef3e6 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# 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 ) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/backtrace_silencers.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/cookies_serializer.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/filter_parameter_logging.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/inflections.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/mime_types.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/session_store.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/session_store.rb new file mode 100644 index 0000000..235f41f --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_TestingFactoryApp_session' diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/wrap_parameters.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/locales/en.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/routes.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/routes.rb new file mode 100644 index 0000000..c73057e --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/routes.rb @@ -0,0 +1,60 @@ +Rails.application.routes.draw do + + # get 'users/new' + resources :users + + # 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' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/secrets.yml b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/secrets.yml new file mode 100644 index 0000000..fe7398d --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: a4443993792bd3a9bb69b3fc88dddc862d779f6fd58fa5030cff729e127cee4f46ea0f491b049f3d0c1e5343fdbcad22cb70beab21685c79240e90e568ea72ce + +test: + secret_key_base: 8dd0c664e8f269196820d1151b9fcf1311e93421df4fc1a7414054a5160f1c99c0608fec148d20dbbbe7fc6d54f2aaf519e943aedddb58ebffaf23951d9815c4 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/migrate/20180813183509_create_users.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/migrate/20180813183509_create_users.rb new file mode 100644 index 0000000..cc285fe --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/migrate/20180813183509_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :first_name + t.string :last_name + t.string :email + + t.timestamps null: false + end + end +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/schema.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/schema.rb new file mode 100644 index 0000000..0ed6414 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/schema.rb @@ -0,0 +1,24 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20180813183509) do + + create_table "users", force: :cascade do |t| + t.string "first_name" + t.string "last_name" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/seeds.rb b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/seeds.rb new file mode 100644 index 0000000..4edb1e8 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/lib/assets/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/lib/tasks/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/log/.keep b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/public/404.html b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/ObiFenix-RubyStack/Ruby-Stack/Rails/platform-sample-assign/TestingFactoryApp/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
++ Don't have an account yet? + Create one now! +
++ Already have an account? + Login now! +
+<%= notice %>
<% end %> + <% if session['form'] == 'login' %><%= render "login_form" %> + <% else %> <%= render "register_form" %> + <% end %> +<%= notice %>
+ <% end %> +| Artist | +Title | +No. of Time This Song Has Been Added | +Actions | +
|---|---|---|---|
| <%= song.artist %> | +<%= song.title %> | +<%= song.users.count %> | ++ + | +
| Name | +Times Added | +
|---|---|
| + + <%= User.find(song.user_id).first_name %> + <%= User.find(song.user_id).last_name %> + + | +<%= Playlist.where(user_id: song.user_id).where(song_id: song.song_id).count%> | +
<%= notice %>
+ <% end %> +| Artist | +Title | +Times Added | +
|---|---|---|
| <%= Song.find(song.song_id).artist %> | +<%= Song.find(song.song_id).title %> | +<%= Playlist.where(user_id: song.user_id).where(song_id: song.song_id).count%> | +
You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+