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
//reducer.js | |
initState = { | |
foo: { | |
value_a: "", | |
value_b: "" | |
}, | |
bar: { | |
value_a: "", | |
value_b: "" |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ration: 1.5) { | |
body { | |
background-image: url(subtle_dots_@2X.png); | |
} | |
} |
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
$(document).ready(function () { | |
$("small.error").each(function(){ | |
(this).closest("input").addClass("error"); | |
}); | |
}); | |
<input class="string email optional" id="contact_form_email" name="contact_form[email]" size="50" type="email" value="fdsfs"> | |
<small class="error">is invalid</small> |
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
When I first started my journey into rails I had no practice with HTML or CSS, and was looking | |
to try out the skills I had gained from Team Treehouse and various books. I started the Michael | |
Hartl Rails tutorial and about 4 chapters in I got to a point where I could build my first website. | |
Despite the fact I wasn’t harnessing the power of Rails and it’s RESTful routes, which makes creating, | |
updating and destroying a record of the database a simple task, I was gaining valuable skills that will | |
now allow me to create nice, user friendly web apps. I then realized that until you start going through | |
the motions and actually apply the knowledge you’ve learned through books and online tutorials, it’s | |
hard to retain any of it. So I’m going to break down what I learned in the Hartl tutorial and walk you | |
through the steps to create a static website “sandbox” to test out HTML and CSS. | |
The first thing you’ll need to do is get Rails installed on your computer, refer to section 1.2.2 'Ruby, |
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> | |
var $btn2 = $('.info-pop'); | |
$btn2.popover({trigger: 'hover'}) | |
.one('click', function() { | |
$btn2.popover('destroy') | |
.popover({ trigger: 'click'}) | |
.popover('show'); | |
}); | |
</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
class PostsController < ApplicationController | |
before_filter :authenticate_user!, except: [:index, :show] | |
# GET /posts | |
# GET /posts.json | |
def index | |
@posts = policy_scope(Post) | |
respond_to do |format| | |
format.html # index.html.erb |
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
class Comment < ActiveRecord::Base | |
belongs_to :commentable, polymorphic: true | |
validates :content, presence: true | |
validates :author_email, presence: true | |
validates :author, presence: true | |
end | |
class Project < ActiveRecord::Base | |
attr_accessible :name, :technologies_used | |
validates :technologies_used, presence: true |