This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------- | |
new.html.erb --> PARTIAL FORMS | |
------------------------------------------------------------- | |
<div id="main"> | |
<h1><em>Wish U Were Here</em></h1> | |
<% if logged_in? %> | |
<p>Hi, <%= current_user.name %>!<br><br> | |
<img src=<%= current_user.image_url %> alt="User Profile Pic" /> | |
<br> | |
<span class="tagline">Where would YOU rather be?</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###### seed.rb ################### | |
###################################### | |
Complaint.delete_all | |
url = "http://data.cityofnewyork.us/resource/erm2-nwe9.json" | |
response = HTTParty.get(url) | |
response.each do |incident| | |
# c = Complaint.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.) Add the gem 'jasmine' to your gemfile like so: | |
group :development, :test do | |
gem 'launchy' | |
gem 'capybara' | |
gem 'pry-rails' | |
gem 'selenium-webdriver' | |
gem 'rspec-rails', '~> 3.0.0.beta' | |
gem 'jasmine' | |
# gem 'guard' | |
# gem 'guard-rspec' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------- | |
Palindrome.rb | |
---------------------------------------------------------- | |
# In ActiveRecord docs as 'validates_with' | |
class ValidPalindrome < ActiveModel::Validator | |
def validate(record) | |
test_string = record.text | |
unless test_string == test_string.reverse | |
record.errors[:text] << 'This is not a Palindrome.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- views/picture/index.html.erb --> | |
<% if flash[:msg] %> | |
<%= flash[:msg] %> | |
<% end %> | |
<br> | |
<%= link_to "create picture", new_picture_path(@picture) %> | |
<br> | |
<br> | |
<% @pictures.each do |picture| %> | |
<img src="<%= picture.image_url %>" alt="" width="300px"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
________________________________________________________________________ | |
**** GIT HUB WITH GROUP PROJECTS **** | |
________________________________________________________________________ | |
* git branch -d → Will delete the branch completely if it SUCKS. | |
* AlWAYS pull first before you start your work. | |
* git checkout develop → Never work on master branch. | |
- Your MASTER branch must always work. | |
________________________________________________________________________ | |
** Beginning of Day: ** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------- | |
---- searches_controller.rb ----- | |
--------------------------------- | |
def create | |
# 1.) js file | |
# 2.) click event to prevent default route to the controller from js with the url. | |
# get value from form | |
# ajax request to send form data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Go to herokuapp dashboard | |
2. Go to your app --> then 'settings' | |
3. Click on 'Get add ons' --> Then find 'New Relic' and click to read the docs | |
4. Then from within your app in the terminal type: heroku addons:add newrelic:stark | |
5. Go back to your app on heroku and click on the "New Relic" icon. | |
6. Then in the page that opens up click on 'I agree' | |
7. Add this gem to your gemfile --> gem 'newrelic_rpm' in production - like so: | |
group :production do | |
gem 'newrelic_rpm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whenever you make any changes: | |
(You must add and commit all changes BEFORE trying to pull or else it won't work) | |
1.) cd into that folder where the changes are located. | |
2.) git add . (This will add all changes, if that doesn't work git add -A) | |
3.) git commit -m "Your commit message goes here...blah, blah." | |
4.) git pull upstream master --> This will make sure that you have the most recent files. | |
5.) git push origin master (This pushes up all your changes to your repo) | |